I've got a SELECT statement that is returning the data I want, but not
in the right order (and I don't know why...). Let's say there are two
tables, People and History. Some records in People have corresponding
records in History, but not all--so I need a LEFT JOIN TO connect
history.people_id to people.id. So far, so good. But I want to order
the list according to the timestamp column in history
(history.time_sec), and this does not happen: Records are returned, but
not in the right order. Here's my query:
SELECT *
FROM people
LEFT JOIN history ON people.id = history.people_id
GROUP BY people.id
ORDER BY history.time_sec DESC
It seems I can sort correctly on a field in people, but not on a field
in history—is that because it is a left-joined table?
...Rene
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]