Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mystifier
Starting Member
12 Posts |
Posted - 2012-03-03 : 13:59:11
|
Can anyone help a newbie with this query:DATAClient01, Status1Client02, Status1Client03, Status2Client04, Status3Client05, Status3Client06, Status3SELECT COUNT(*) FROM DATA WHERE Status = 'Status1' would tell me how many clients were Status1 but I want a summary for each statusREQUIRED OUTPUTCountOfStatus1(2), CountOfStatus2 (1), CountOfStatus3 (3) |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2012-03-03 : 17:29:56
|
SELECT Status, COUNT(*) FROM Data GROUP BY Status ORDER BY Status N 56°04'39.26"E 12°55'05.63" |
|
|
mystifier
Starting Member
12 Posts |
Posted - 2012-03-03 : 19:10:54
|
Perfect SwePeso,Thank-you. |
|
|
|
|
|