I want to delete from a table the entries where it has multiple values for Date field.
So say I have Employee table - Id,Name,Date,Points
I want to delete the entries with same Date field which should be unique…just to cleanup
I need to just keep a single entry for date and delete the rest…maybe keep the recent one if possible….
Can anyone please suggest a update query to do this?
Use:
The GROUP BY isn’t likely to be necessary due to the WHERE clause & only returning one column with an aggregate function on it, but it’s included to be safe. This is assuming that when the OP says date field, being SQL Server 2008 that means the DATE data type, not DATETIME.