RE: Row counts in SQL 2000

RE: Row counts in SQL 2000

 

  

Select Customer,Count(Customer)
FROM [MyTable]
GROUP BY Customer

-----Original Message-----
From: Agarwalla Avineet (Corporate)
[mailto:mssqldba-ezmlmshield-x14449456.[Email address protected]
Sent: Monday, June 28, 2004 1:32 PM
To: LazyDBA Discussion
Subject: Row counts in SQL 2000


Hi All,

I need help in writing a SQL command to count the # of rows for each value in a table's column. I have 21 distinct values for a column Customer in the table Contact. How do I do this?


Thanks & Regards,

Avineet Agarwalla

This e-mail, together with any attachments, is confidential. It may be read, copied and used only by the intended recipient. If you have received it in error, please notify the sender immediately by e-mail or telephone. Please then delete it from your computer without making any copies or disclosing it to any other person. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]


MS Sql Server LazyDBA home page