I think this should work,
select
Id,count(Id)
from
mytable
group by
Id
having
count(id)>1
It will also show you how many of each Id's you have, you can naturally add
a where clause if you want.
Jason Lees
Development Team Leader
National Express.
-----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