|
I'm not sure why it isn't working for you, unless perhaps you're using
MySQL, which doesn't support FULL OUTER JOIN. But in that case you should've
received an error message, rather than no results.
Here's an alternate strategy:
SELECT usr
, SUM(CASE WHEN act = 'ADD'
THEN 1
ELSE 0 END) AS ADD
, SUM(CASE WHEN act = 'UPD'
THEN 1
ELSE 0 END) AS UPD
FROM RGS8
WHERE act IN ('ADD','UPD')
AND dte = 20080310
GROUP
BY usr
This should perform better as well, since it requires only one pass of the table.
|