sql - Remove dupes from recordset excluding columns from dupe condition -
I am against an mssql database like a SQL query ... ID, type, start, stop, select all from a union, select ID, type, start, stop, one, two, three, four U union Select all ID, type, start, stop, Results in : line | Starting an ID type One two three four---- + ------------------------------------- ------------------------- 1. 1 a 2010-01-01 2010-01-31 100 1000 1000 100 2 | 1 a 2010-02-01 2010-12-31 100 500 500 50 3 | 1B 2010-01-01 2010-01-31 100 NULL NULL 100 4 | 1B 2010-01-01 2010-12-31 100 Nal faucets 100 5 | 1C 2010-01-01 2010-01-31 0 Tube Touches 100 6 | 1c 2010-01-01 2010-12-31 0 NULL NULL 100 However, I would prefer the following results instead ... line | Starting an ID type One two three four---- + ------------------------------------- ------------------------- 1. 1 a 2010-01-01 2010-01-31 100 1000 1000 100 2 | 1 A 2010-02-01 2010-12-31 100 500 500 50 4 1B 2010-01-01 2010-12-31 100 Nal Faucets 100 6 | 1 C 2010-01-01 2010-12-31 0 NULL NULL 100 That is, after d...