t-sql to count how many times a column's value is in a table
SELECT distinct(a.Col1),
(Select count(Col1) FROM [Table] b where a.Col1= b.Col1) as colcount
FROM [Table] a
group by a.Col1 having (Select count(Col1) FROM [Table] b where a.Col1 = b.Col1 ) > 1
order by colcount desc
Patrick McNamara, BS-IS/CS, MBA, MAED
ASP.NET Web Application Developer
Asteryx, LLC.
http://asteryx.com
pat@asteryx.com