안녕하세요 아래 쿼리에 insert를 위한 /*+ append parallel(a,4)*/ 힌트를 주고 싶은데,
저렇게 안에 서브쿼리가 있는 문은 어떻게 append parallel 힌트를 줘야 하나요..
고수님들 좀 알려주시면 감사하겠습니다!
SELECT '20140319' sikdate
, pernr
, work_name
, COUNT(DECODE(gb, 1, 1)) 1
, COUNT(DECODE(gb, 1, 1)) * 1000 2
, SUBSTR(MIN(DECODE(gb, 1, regi_time)), 1, 4) 3
, COUNT(DECODE(gb, 2, 1)) 4
, COUNT(DECODE(gb, 2, 1)) * 1000 5
, SUBSTR(MIN(DECODE(gb, 2, regi_time)), 1, 4) 6
, COUNT(DECODE(gb, 3, 1)) 7
, COUNT(DECODE(gb, 3, 1)) * 1000 8
, SUBSTR(MIN(DECODE(gb, 3, regi_time)), 1, 4) 9
, COUNT(DECODE(gb, 4, 1)) 10
, COUNT(DECODE(gb, 4, 1)) * 1000 11
, SUBSTR(MIN(DECODE(gb, 4, regi_time)), 1, 4) 12
FROM (SELECT a.pernr, b.work_name, a.regi_time
, CASE WHEN a.regi_date||a.regi_time >= 'YYYYMMDDHH24MISS'
AND a.regi_date||a.regi_time <= 'YYYYMMDDHH24MISS'THEN 1
WHEN a.regi_date||a.regi_time >= 'YYYYMMDDHH24MISS'
AND a.regi_date||a.regi_time <= 'YYYYMMDDHH24MISS'THEN 2
WHEN a.regi_date||a.regi_time >= 'YYYYMMDDHH24MISS'
AND a.regi_date||a.regi_time <= 'YYYYMMDDHH24MISS'THEN 3
WHEN a.regi_date||a.regi_time >= 'YYYYMMDDHH24MISS'
AND a.regi_date||a.regi_time <= 'YYYYMMDDHH24MISS'THEN 4
END AS gb
FROM from ABC a
INNER JOIN DEF b
ON a.term_id = b.Term_id
WHERE b.work_name = '대전'
AND a.regi_date >= 'YYYYMMDD'
AND a.regi_date <= 'YYYYMMDD'
AND a.regi_date||a.regi_time >= 'YYYYMMDDHH24MISS'
AND a.regi_date||a.regi_time <= 'YYYYMMDDHH24MISS'
)
WHERE gb IS NOT NULL
GROUP BY pernr, work_name
;
|