Avatar of Dovberman
Dovberman
Flag for United States of America

asked on 

How to Display Each of Two Count Statements in a Different Row

SET NOCOUNT ON;
select
 sum(case when PctUp between 4 and 6 then 1 else 0 end) as Count1
 ,sum(case when PctUp between 4 and 8 then 1 else 0 end) as Count2

from Exceptions where pctUp between 4 and 8;
END

Returns:

Count1          Count 2

451                 672

Would like to return:

ExceptionCount     LowPct     HighPct

451                           4                 6
672                           4                 8

How can this be done?

Thanks,
Microsoft SQL Server 2008Microsoft SQL ServerMicrosoft Development

Avatar of undefined
Last Comment
Dovberman

8/22/2022 - Mon