troubleshooting Question

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

Avatar of Dovberman
DovbermanFlag for United States of America asked on
Microsoft SQL Server 2008Microsoft SQL ServerMicrosoft Development
6 Comments3 Solutions744 ViewsLast Modified:
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,
ASKER CERTIFIED SOLUTION
deighton
prog

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros