SELECT COUNT(id_col), id_col FROM myTable
GROUP BY id_col
HAVING COUNT(id_col) > 1

Should do the trick for you,

Alex

> -----Original Message-----
> From: Wurst, Keith D. [mailto:[EMAIL PROTECTED] 
> Sent: 19 August 2003 15:10
> To: CF-Talk
> Subject: sql question
> 
> 
> i would like to write a sql query that can find where a 
> certain 'id' has a duplicate. i don't want to see the ids 
> where there is only one instance of it. (for example, show me 
> 20010001 if there are 2 of them in the db, and don't show me 
> 20010002 if there is only one of them in the db). anyone have 
> any suggestions? thanks.
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to