티스토리 뷰
oracle decode를 사용하면 like비교를 할수 없다.
이때는 case 문을 써야 한다.
아래 샘플은 Proframe5c의 DBIO 구조체 이름을 조회해서 DBIO명을 추출하는 쿼리이다.
select distinct case when resource_id like '%Bundle' then substr(resource_id, 1, length(resource_id)-6)
when trim(resource_id) like '%BundleOut' then substr(resource_id, 1, length(resource_id)-9)
when resource_id like '%Out' then substr(resource_id, 1, length(resource_id)-3)
when resource_id like '%In' then substr(resource_id, 1, length(resource_id)-2)
when resource_id like '%_t' then substr(resource_id, 1, length(resource_id)-2)
else resource_id
end as resource_id
from dev_resource
where resource_type = 'STRUCTURE'
and resource_group = 'POC2'
order by resource_id
'Oracle' 카테고리의 다른 글
| LIKE연산으로 '%'나 '_'가 들어간 문자를 검색하기 (0) | 2021.01.28 |
|---|
- Total
- Today
- Yesterday
- dlopen()
- TDL
- dlsym()
- RedHat8 #network 껏다켜기
- dlerror()
- like
- jdk5 #autoboxing #unboxing #redjacob
- dlclose()
- outlook 검색
- ORA-00845
- decode
- ksh
- c #long_to_char_and_restore
- common_parser #oracle19c #pro*c #DBIO
- oracle
- SQL
- LC_ALL #LANG #한글깨짐
- struct padding #struct align
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
