Here are my thoughts - but it is done with no data or testing to back them up, so.....One possibility is to use an aggregate function as shown below. But, this has the problem that Office_ID2 may be picked from one row and Source might be picked from another row. If that is a problem, this would not workSELECT Date, ID, Office_ID, MAX(Office_ID2) AS Office_ID2, MAX(Source) AS SourceFROM TblGROUP BY Date, ID, Office_ID
Another possiblity which may speed up the subsequent queries that use this result set is to create a temp table as shown below and insert the data into that table (using your approach, or the one above) and then join with that temp table.CREATE TABLE #data(Date DATETIME, ID INT NOT NULL, Office_ID INT NOT NULL, Office_ID2 INT NOT NULL , Source VARCHAR(32) PRIMARY KEY CLUSTERED (Id, Office_ID, Office_ID2));