select *
from
(
SELECT BBS_DIV, COUNT(*) SEARCH_CNT
FROM T_BBS A
WHERE '^^' = '^^'
AND BBS_DIV IN ('QNA', 'FAQ', 'GON', 'FST')
AND STATUS = 'ACT'
AND (SUBJCT LIKE '%%' OR CONT LIKE '%%')
GROUP BY BBS_DIV
UNION
SELECT BBS_DIV, COUNT(*) SEARCH_CNT
FROM T_BBS A
WHERE '^^' = '^^'
AND BBS_DIV IN ('EVT')
AND STATUS = 'ACT'
AND (SUBJCT LIKE '%%' OR DBMS_LOB.INSTR(CONT_CLOB, '')>0 )
GROUP BY BBS_DIV
UNION
SELECT SRC_TABLE AS BBS_DIV, COUNT(*) SEARCH_CNT
FROM T_SEARCH_INDEX A
WHERE '^^' = '^^'
AND (TITLE LIKE '%%' OR DBMS_LOB.INSTR(CONTENT, '')>0 )
GROUP BY SRC_TABLE
)
order by (case
when bbs_div = 'EVT' then 2
when bbs_div = 'FAQ' then 4
when bbs_div = 'FST' then 3
when bbs_div = 'GON' then 5
when bbs_div = 'QNA' then 6
when bbs_div = 'T_BOARD_01' then 1
end ) ASC
'프로그래밍 > oracle' 카테고리의 다른 글
oracle - 오라클에서 자동증가칼럼(Sequence) 사용하기 (0) | 2012.08.17 |
---|---|
oracle - [오라클]인덱스 100% 활용하자 (0) | 2012.08.17 |
oracle - 요일계산(3) (0) | 2012.08.17 |
oracle - 요일계산(2) (0) | 2012.08.17 |
oracle - 오라클에서 힌트(Hint) 사용 예제 (0) | 2012.08.17 |