Results 1 to 3 of 3

Thread: Why is it completely ignoring this (MySQL)

  1. #1
    Join Date
    Jun 2006
    Under your bed

    Question Why is it completely ignoring this (MySQL)

    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?
    The better I get at programming, the more I appreciate arrays. Handy dandy things they are.

  2. #2
    Join Date
    Aug 2005
    The Garden State
    because order by clauses are written like:

    (column name [ASC|DESC] )*
    No comma.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Jan 2007
    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?
    Jon Wire

    thepointless.com | rounded corner generator

    I agree with Apple. Flash is just terrible.

    Use CODE tags!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles