Results 1 to 3 of 3
Jan 8, 2013, 15:41 #1
- Join Date
- Sep 2001
- 0 Post(s)
- 0 Thread(s)
How can I have an ORDER BY with LEFT JOIN?
My tables and their fields:
1.) client (fields: clientID, clientName)
2.) conversation (fields: conversationClientID, conversationText, conversationTimestamp)
SELECT * FROM client LEFT JOIN conversation ON (conversationClientID = clientID) WHERE clientType = 'prospect' GROUP BY clientID ORDER BY clientName, conversationTimestamp DESC
I want all my clients on a list on alphabetic order and with that client I only want the last call to be shown.
With my query, the list of clients is ok, but it shows the first conversation of the client and not the last according to the timestamp. How can I achieve this?