SELECT DISTINCT
COUNT(tbl.Customer) AS NumRec
, tbl.Customer
FROM
dbo.Contact AS tbl
GROUP BY
tbl.Customer
ORDER BY
tbl.Customer
--- "Agarwalla Avineet (Corporate) "
<mssqldba-ezmlmshield-x14449456.[Email address protected]
wrote:
> 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]
>
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
MS Sql Server LazyDBA home page