This probably means that your select distinct does not include all of the columns in the table. You would have to either explicitly list the columns in the insert statement, or select all of the columns, in the correct order, in your select statement.
I personally would recommend both! Steve ------------------------------------- Steven Monaghan Oracle DBA / Cold Fusion Developer MSC Industrial Direct Co., Inc. http://www.mscdirect.com ------------------------------------- -----Original Message----- From: Bruce Sorge [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 4:53 PM To: SQL Subject: Remove Duplicates Query I have inherited an application that has a DTS package. One of the functions in this package is to remove duplicates from a table. The query looks like this: SELECT DISTINCT(nurseID), fname, lname, careerLadder, bcon, ssn, domainAccount INTO #nursesDistinct FROM nurses; DELETE FROM nurses; INSERT nurses SELECT * FROM #nursesDistinct; DROP TABLE #nursesDistinct; Problem is that this does not work. When I run this I receive an error message: Error Description: Insert Error: Column name or number of specified values does not match table definition. What does this mean? Thanks, Bruce ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6 Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
