¡á¿¹ 14_1 || ÀÏÀÚº° ÀüÇ¥³â¿ùÀÏÁý°è Å×À̺í INSERT
DELETE * FROM ³â¿ùÀÏÁý°è
WHERE ¹ßÇà³â¿ùÀÏ = :IN_TODAY;
INSERT INTO ³â¿ùÀÏÁý°è
(°Å·¡Ã³ÄÚµå, ¹ßÇà³â¿ùÀÏ,ÀÔÃⱸºÐ,±Ý¾×)
____SELECT °Å·¡Ã³ÄÚµå, :in_today , ÀÔÃⱸºÐ, SUM(±Ý¾×)
FROM ÀüÇ¥
WHERE ¹ßÇàÀϽà >= TO_DATE(:in_today, 'YYYYMMDD')
AND ¹ßÇàÀϽà < TO_DATE(:in_today, 'YYYYMMDD')+1
GROUP BY °Å·¡Ã³ÄÚµå, ÀÔÃⱸºÐ;
¡á¿¹ 14_1_2 || ÀÏÀÚº° ÀüÇ¥³â¿ùÀÏÁý°è Å×À̺í INSERT
SELECT °Å·¡Ã³ÄÚµå, ÀÔÃⱸºÐ, SUM(±Ý¾×)
FROM
(--Áý°èÅ×ÀÌºí¿¡¼ ÀüÀÏÀÚ ±îÁö °¡Á®¿Â´Ù.
SELECT °Å·¡Ã³ÄÚµå, ÀÔÃⱸºÐ, ±Ý¾×
FROM ³â¿ùÀÏÁý°è
WHERE ¹ßÇà³â¿ùÀÏ >= :IN_FROM_DATE
AND ¹ßÇà³â¿ùÀÏ < TO_CHAR(SYSDATE,'YYYYMMDD')
UNION ALL
--¿À´Ã ÀüÇ¥¹ß»ý µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.
SELECT °Å·¡Ã³ÄÚµå, ÀÔÃⱸºÐ, ±Ý¾×
FROM____ ÀüÇ¥
WHERE ¹ßÇàÀϽà >= TO_DATE(TO_CHAR(SYSDATE,'yyyymmdd'))
AND ¹ßÇàÀϽà <= SYSDATE )
GROUP BY °Å·¡Ã³ÄÚµå, ÀÔÃⱸºÐ;