Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning the most recent of several rows
Message
From
16/01/2002 15:29:44
Jason Dalio
Northern Interior Regional Health Board
Prince George, British Columbia, Canada
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00605632
Message ID:
00605654
Views:
11
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform