Quote:
Originally posted by ansonee
I would like to do this in one statement if possible I figured I could do it in a stored proc (create temp table and populate with the counts).
|
Sure you can, use a scalar sub-query! Pretty standard fair for retrieving mutiple totals in a single query. Apparently these aren't supported on all versions of DB2 which I find unbelievable!
SELECT (
SELECT COUNT(*)
FROM AIMD.AIMQUERY
WHERE ERRORSEVERITY IS NOT NULL
OR ERRORMESSAGE IS NOT NULL
OR ERRORTYPE IS NOT NULL
) AS "UNFULFILLED REQUESTS"
, SELECT COUNT(*) AS "FULFILLED REQUESTS"
FROM AIMD.AIMQUERY
WHERE ERRORSEVERITY IS NULL
OR ERRORMESSAGE IS NULL
OR ERRORTYPE IS NULL;