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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Distinct count for ticket count

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2013-03-07 : 10:16:10
Hello there.

Have a table with

customer_Id, gameName,

I want to select a distinct count for each game name,

at the moment I have have the following that will give me a total count for each game name.
But how do I count distinct customer id for each game name.

select game_name, COUNT (customer_id) from dbo.games

group by game_name

Regards

Rob

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2013-03-07 : 10:18:29
sorted

select game_name, COUNT (distinct customer_id) from dbo.games

group by game_name
Go to Top of Page
   

- Advertisement -