Obsidian/Recognition/Work Related/프로젝트/스마트계류장/1.데이터베이스/EAI-Data Item 추출작업.md

45 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2023-08-14 16:19:25 +00:00
- Item CODE 작업 & 업데이트
``` SQL
select data_item, field , item_code, mdd_gubun, mdd_div_cd, use_yn, ex_Text , no, gubun, menu , DISP_DIV , menu_DESC , bigo
from iis_data_item
-- where item_code like '%PAD%'
where lower(data_item) like '%호출부호%'
select data_item, field , item_code, mdd_gubun, mdd_div_cd, use_yn, ex_Text , no, gubun, menu , DISP_DIV , menu_DESC , bigo
from iis_data_item
where item_code like '%#%'
```
-- 항목 요약
``` SQL
select item_code , max(Data_item), count(*) as cnt
from iis_data_item
where use_yn is null
group by item_code
order by 1 desc
```
-- EIA MDD 검색
```SQL
-- 전체검색
select *
from eai_mdd
where upper(concat(item_code, '^', item_nm, '^', item_desc)) like concat('%', 'R-T', '%')
-- 특정 단여 검색
select *
from eai_mdd
where binary(concat(item_code, '^', item_nm, '^', item_desc)) like concat('%', 'RT', '%')
-- 한글검색
select *
from eai_mdd
where binary(replace(concat(item_code, '^', item_nm, '^', item_desc),' ','')) like concat('%', replace('주기장 번호',' ',''), '%')
```