I have a temptable that looks like this:
RequestID | CreatedDate | HistoryStatus
CF-0000001 | 8/26/2009 1:07:01 PM | For Review
CF-0000001 | 8/26/2009 1:07:01 PM | Completed
CF-0000112 | 8/26/2009 1:07:01 PM | For Review
CF-0000113 | 8/26/2009 1:07:01 PM | For Review
CF-0000114 | 8/26/2009 1:07:01 PM | Completed
CF-0000115 | 8/26/2009 1:07:01 PM | Completed
And how I'd like the table to look at the end is like this:
RequestID | CreatedDate | HistoryStatus
CF-0000001 | 8/26/2009 1:07:01 PM | Completed
CF-0000112 | 8/26/2009 1:07:01 PM | For Review
CF-0000113 | 8/26/2009 1:07:01 PM | For Review
CF-0000114 | 8/26/2009 1:07:01 PM | Completed
CF-0000115 | 8/26/2009 1:07:01 PM | Completed
I.e. the duplicate CF-0000001
should be removed.
How can I return or should i say choose only ONE row if there are multiple duplicate rows and still return rows that are not duplicates?
See Question&Answers more detail:os