Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Counting several specific rows (using where) in the same column

$
0
0

Hi everyone, 

SQL Server 2008 newbie here!

The subject says it all really, I hope! I would like the count the number of rows in a column with a specific id, several times. So:

SELECT COUNT (*)

FROM...

WHERE column = 100. 

But I want to do this 60 times for this column, for 60 different values. 

Is there a way of doing it so I don't have to execute this query 60 times and then type the answer into excel?

Look forward to your replies!

Thanks :)

Preet


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>