1 2 3 4 5
| SELECT A.Jour, A.HoraireArr, A.CommuneArr, A.ArretArr, A.Distance
FROM Donnees AS A INNER JOIN (SELECT Jour, HoraireArr, CommuneArr, ArretArr, Max(Distance) AS DistanceMax FROM Donnees AS C GROUP BY C.Jour, C.HoraireArr, C.CommuneArr, C.ArretArr) AS B ON (A.Jour = B.Jour) AND (A.HoraireArr = B.HoraireArr) AND (A.CommuneArr = B.CommuneArr) AND (A.ArretArr = B.ArretArr) AND (A.Distance = B.DistanceMax)
WHERE A.Suspendu = 0
GROUP BY A.Jour, A.HoraireArr, A.CommuneArr, A.ArretArr, A.Distance
ORDER BY A.Jour, A.HoraireArr; |
Partager