I Have a query I need to either disticnt or group I cant get either to work
Normal query below
SELECT TOP 10 [UserLogin]
,[comm_id]
,[CaseID]
,[Creation_Date]
,[Supervisor]
,[YearWeek]
FROM Correspondences_All where userlogin = 'blah'
it returns:
UserLogin comm_id CaseID Creation_Date Supervisor YearWeek
Blah 24584076055 1283974401 12:42.0 Supervisor1 201307
Blah 24552235745 1283974401 14:20.0 Supervisor1 201306
Blah 24556867065 1283974401 03:18.0 Supervisor1 201306
Blah 24648408055 1283974401 11:54.0 Supervisor1 201309
Blah 24531485005 1484627711 36:24.0 Supervisor1 201305
Blah 24522586555 1484627711 24:52.0 Supervisor1 201305
Blah 24527107785 1484627711 58:30.0 Supervisor1 201305
Blah 24528286905 7684732591 00:04.0 Supervisor1 201305
Blah 24560995615 1285109231 37:14.0 Supervisor1 201306
Blah 24561807655 1285109231 15:41.0 Supervisor1 201306
I need something like this:
UserLogin comm_id CaseID Creation_Date Supervisor YearWeek
Blah 24584076055 1283974401 12:42.0 Supervisor1 201307
Blah 24531485005 1484627711 36:24.0 Supervisor1 201305
Blah 24528286905 7684732591 00:04.0 Supervisor1 201305
Blah 24560995615 1285109231 37:14.0 Supervisor1 201306
Note that I am doing this at the CasedID level. I can go this no problems in mySQL using a group by but SQL server is not so kind
MYSQL =
SELECT TOP 10 [UserLogin]
,[comm_id]
,[CaseID]
,[Creation_Date]
,[Supervisor]
,[YearWeek]
FROM Correspondences_All where userlogin = 'blah'
order by caseID