Order by first column, then second column

I’m trying to sort the results first by their list name, then their date, but it’s not working. Any thoughts?

SELECT f.fID, f.date, f.tID, f.list, t.summary FROM favorites f, testimonies t where f.uID = ‘110’ and f.tID = t.tID order by f.list, f.date

i’m sorry, i am not familiar with the “it’s not working” error message

:slight_smile:

Try:

SELECT
      f.fID
    , f.date
    , f.tID
    , f.list
    , t.summary
FROM
    favourites AS f
INNER JOIN
    testimonies AS t
ON
    f.tID = t.tID
WHERE
    f.uID = 110
ORDER BY
      f.list
    , f.date

When working with two or more tables, you need to use the proper JOIN syntax for the approprite JOIN that you need.

It alse depends on which part of the date you would like to order (day, month or year?)

yeah, but this has nothing to do with the stated problem, achieving a specific order