Quoting Srimanta <[EMAIL PROTECTED]>: > > I have a table with 18000 records. > There are three fields say field1, field2 and field3. > There are no primary keys at the moment. > > I want to delegate field1 as the primary key in the modified table. > When I try to create field1 as the primary key, an error is generated > as there are duplicate values in the records in field1. > How do I find which values are duplicate in field1.
SELECT field1, Count(field1) FROM table GROUP BY field1 HAVING Count(field1) > 1 Jochem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm