Hello ...
I have a query that extracts the following data:
result set in a daily format:
[tt]
EFFECTIVE PACKET PACKET
DT TYP COUNT
---------- ------- -----------
2006-05-24 NON-STA 25
STA 17
2006-05-23 NON-STA 3
STA 12
2006-05-21 NON-STA 33
STA 34
2006-05-19 NON-STA 20
STA 12
2006-05-17 NON-STA 15 [/tt]
However, I want to get a summarized monthly "grouped" count like:[tt]
EFFECTIVE PACKET PACKET
DT TYP COUNT
---------- ------- -----------
2006-05 NON-STA 325
STA 417
2006-04 NON-STA 33
STA 412
2006-03 NON-STA 333
STA 434
2006-02 NON-STA 320
STA 412
2006-01 NON-STA 315 [/tt]
Can anyone provide me some suggestions?
Thanks in advance ...
I have a query that extracts the following data:
Code:
SELECT EFFECTIVE_DT,
PACKET_TYP,
COUNT(PACKET_TYP)
FROM RCX1.TPACKET_TEMP
WHERE PACKET_TYP = 'STA'
GROUP BY EFFECTIVE_DT,
PACKET_TYP
UNION ALL
SELECT EFFECTIVE_DT,
PACKET_TYP,
COUNT(PACKET_TYP)
FROM RCX1.TPACKET_TEMP
WHERE PACKET_TYP = 'NON-STA'
GROUP BY EFFECTIVE_DT,
PACKET_TYP
ORDER BY EFFECTIVE_DT DESC,
PACKET_TYP;
[tt]
EFFECTIVE PACKET PACKET
DT TYP COUNT
---------- ------- -----------
2006-05-24 NON-STA 25
STA 17
2006-05-23 NON-STA 3
STA 12
2006-05-21 NON-STA 33
STA 34
2006-05-19 NON-STA 20
STA 12
2006-05-17 NON-STA 15 [/tt]
However, I want to get a summarized monthly "grouped" count like:[tt]
EFFECTIVE PACKET PACKET
DT TYP COUNT
---------- ------- -----------
2006-05 NON-STA 325
STA 417
2006-04 NON-STA 33
STA 412
2006-03 NON-STA 333
STA 434
2006-02 NON-STA 320
STA 412
2006-01 NON-STA 315 [/tt]
Can anyone provide me some suggestions?
Thanks in advance ...