Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning the most recent of several rows
Message
De
16/01/2002 15:29:44
Jason Dalio
Northern Interior Regional Health Board
Prince George, Colombie Britannique, Canada
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00605632
Message ID:
00605654
Vues:
9
Yup:

SELECT LastName, FirstName, StatusCode, TimeCreated, CallID, AssociateID
FROM Customers
INNER JOIN CustStatus ON Customers.CallID = CustStatus.CallID
ORDER BY 6, 1, 2, 4 DESC

becomes

SELECT LastName, FirstName, StatusCode, Max(TimeCreated), CallID, AssociateID
FROM Customers
INNER JOIN CustStatus ON Custmers.CallID = CustStatus.CallID
GROUP BY LastName, FirstName, StatusCode, TimeCreated, CallID, AssociateID
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform