Hi - from my limited expereince in DB2, it appears that you can't
include a case statement in a group by clause - is this correct?
For example, my SQL looked like this:
SELECT CASE WHEN GROUP_CD<'00001' THEN 'ITS' ELSE 'NON' END AS TYPE,
COUNT(*) AS CNT FROM tblCLAIMS GROUP BY CASE WHEN GROUP_CD<'00001' THEN
'ITS' ELSE 'NON' END
My solution was to not initially group the data, and then summarize
the results in another query once the TYPE field had been populated.
Was my syntax incorrect or does DB2 not allow case statements in a
group by clause?
Thanks much!
Dave