Posted by ZeldorBlat on 01/22/08 16:46
On Jan 22, 9:49 am, wackyph...@yahoo.com wrote:
> Is it possibe to combine the results of these 2 queries into a single
> result set consisting of 1 row and 2 columns (for each value)?
>
> SELECT COUNT(*) AS 'SlnCount' FROM Request WHERE RequestTypeID = 2
> SELECT COUNT(*) AS 'NewSlnCount' FROM Request WHERE RequestTypeID = 2
> AND StatusID = 1
SELECT COUNT(*) AS 'SlnCount',
SUM(CASE WHEN StatusID = 1 THEN 1 ELSE 0 END) AS 'NewSlnCount'
FROM Request
WHERE RequestTypeID = 2
Navigation:
[Reply to this message]
|