Click to See Complete Forum and Search --> : Why is it completely ignoring this (MySQL)


evenstar7139
02-10-2009, 09:03 PM
SELECT * FROM thread_reports ORDER BY report_datetime DESC, resolved DESC

It's completely ignoring the "resolved" at the end. Even if I change it to this:

SELECT * FROM thread_reports ORDER BY report_datetime, resolved

But if I do this:
SELECT * FROM thread_reports ORDER BY resolved

Then it makes the "resolved" column a factor in how it orders the results.

Soooo what the heck is going on? Why does it ignore resolved except when it's by itself?

chazzy
02-10-2009, 09:09 PM
because order by clauses are written like:


ORDER BY
(column name [ASC|DESC] )*


No comma.

svidgen
02-10-2009, 10:59 PM
Actually, the initially posted queries should work--sorting by multiple columns does require that the columns be separated by a comma. My initial reaction to the original question is that you're probably misinterpreting what the sort should do. Can you supply some sample output using a small data set and the "broken" query?