UNION을 쓰니 아래와 같이 모양이 나오네요.
SELECT A.A_ISSU_DATE, A.A_ISSU_QTY, A.B_ISSU_DATE, A.B_ISSU_QTY, A.C_ISSU_DATE, A.C_ISSU_QTY
FROM
(SELECT ISSU_DATE AS A_ISSU_DATE, SUM(ISSU_QTY) AS A_ISSU_QTY, '0' B_ISSU_DATE, 0 B_ISSU_QTY, '0' C_ISSU_DATE, 0 C_ISSU_QTY
FROM SDISSLT1
WHERE ISSU_DATE LIKE '201104%' AND ORD_LC_NO = '보관물품' AND CSTM_NO = '10441'
GROUP BY ISSU_DATE
UNION
SELECT '0' A_ISSU_DATE, 0 A_ISSU_QTY, ISSU_DATE AS B_ISSU_DATE, SUM(ISSU_QTY) AS B_ISSU_QTY, '0' C_ISSU_DATE, 0 C_ISSU_QTY
FROM SDISSLT1
WHERE ISSU_DATE LIKE '201104%' AND ORD_LC_NO = '보관물품' AND CSTM_NO = '10260'
GROUP BY ISSU_DATE
UNION
SELECT '0' A_ISSU_DATE, 0 A_ISSU_QTY, '0' B_ISSU_DATE, 0 B_ISSU_QTY , ISSU_DATE AS C_ISSU_DATE, SUM(ISSU_QTY) C_ISSU_QTY
FROM SDISSLT1
WHERE ISSU_DATE LIKE '201104%' AND ORD_LC_NO = '보관물품' AND CSTM_NO = '11865'
GROUP BY ISSU_DATE) A
이렇게 나오는데요
0 0 0 0 20110402 14.27
0 0 0 0 20110404 14.28
0 0 0 0 20110405 14.44
0 0 0 0 20110408 5.05
0 0 0 0 20110411 24.31
0 0 0 0 20110412 9.97
0 0 0 0 20110415 5.09
0 0 0 0 20110418 95.92
0 0 0 0 20110419 14.44
0 0 0 0 20110421 2.138
0 0 20110401 107.26 0 0
0 0 20110402 69.14 0 0
0 0 20110403 41.35 0 0
0 0 20110404 30.93 0 0
0 0 20110412 170.64 0 0
0 0 20110413 59.88 0 0
0 0 20110414 13.13 0 0
0 0 20110418 4.62 0 0
0 0 20110419 15.74 0 0
20110404 315.54 0 0 0 0
20110405 347.41 0 0 0 0
20110406 226.75 0 0 0 0
20110407 482.47 0 0 0 0
20110408 475.69 0 0 0 0
20110409 133.64 0 0 0 0
20110411 430.69 0 0 0 0
20110412 280.97 0 0 0 0
20110413 277 0 0 0 0
20110414 138.24 0 0 0 0
20110415 99.91 0 0 0 0
20110420 162.16 0 0 0 0
20110421 37.122 0 0 0 0
즉...말하자면
20110501 3 0 0
20110503 0 4 0
20110507 0 0 5
이런식으로 나와야 하는데
UNION을 어떻게 사용해야 할까요..
아님 서브쿼리로 어떻게 해봐야할까요..
도움 부탁드립니다.