Advertisements
Home > Sql Server > SQL: Condition in Count()

SQL: Condition in Count()


Condition in count()

SELECT
count(case when EventTypeID =1 then 1 else null end) as TotalTournamentsAttended,
count(case when EventTypeID =2 then 1 else null end) as TotalLeaguesAttended

FROM

[Tables]

 

 

Advertisements
  1. Ashish
    July 7, 2015 at 3:22 am

    Nice Article..

    Thanks Rahul,

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: