Current State id | val | varchar_id| uid ---------------------- 1 | 1 | A4D NEWID() 1 | 2 | A3G NEWID() 2 | 1 | 7S3 NEWID() 2 | 1 | 43E NEWID() 2 | 2 | 7S3 NEWID() 2 | 2 | 431 NEWID() 3 | 1 | 432 NEWID() 3 | 2 | 43P NEWID() Ideal state id | val | varchar_id| ---------------------- 1 | 1 | A4D NEWID() 1 | 2 | A3G NEWID() 2 | 1 | 7S3 NEWID() 2 | 2 | 7S3 NEWID() 3 | 1 | 432 NEWID() 3 | 2 | 43P NEWID() Removing of duplicate occurrences of id + val
I have tried (pseudo code below):
SELECT * from table WHERE uid = MAX GROUP BY id, val Does anyone know of a solution to this/ am I missing something here? I do not mind which of the duplicates are returned.
Also, the version of Sybase I am using does not allow Partition x over x,y functionality.