Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

How to Group By With multiple conditions

$
0
0
Hi,I need help with using COUNT with multiple criteria's. [quote]SELECT DISTINCT CaseStatus, CASE_GROUP_TOTAL = COUNT(CaseStatus)FROM MCJWHERE Case_Group IN ('INPATIENT', 'Outpatient')GROUP BY CaseStatus, Case_Group[/quote]This works however I am unable to tell which one is Inpatient and which one is outpatient without having to go to the data.Is there anything else I can add to show the breakdown for each Inpatient / Outpatient case status.Thanks for any help.

Viewing all articles
Browse latest Browse all 6525

Trending Articles