Delete duplicate rows
Posted on 2008-10-08
Sometimes with this device we have, its possible that duplicate column data will be placed within the SQL Server table. So, we are trying to create a SPROC in which will remove these DUPLICATES but still obviously preserve the data. Basicaly would like the query to be based on the ENTRY_DATE column.
Basically, if there are ANY two entry dates of the same, preserve ONE row and wipe the rest. There will NEVER be TWO entries within the same second, its just not possible.
Example would be
FIRSTNAME LASTNAME ENTRY_DATE
1 Chris Jones 10/7/2008 4:50:00 PM
2 Chris Jones 10/7/2008 4:50:00 PM
3 Chris Jones 10/7/2008 4:50:00 PM
So in the this example, rows 2 and 3 will be deleted, but row 1 will stay because we still want the data.