I have the follow SQL query statement:
SELECT subject, sender_list, date, uid
FROM messages
WHERE folder_id = 3
Can you please tell how can I specify query sort order?
Thank you.
It's actually quite easy. Here's an example to sort your query by the "subject":
SELECT subject, sender_list, date, uid
FROM messages
WHERE folder_id = 3
ORDER BY subject ASC
This will order your list A-Z. If you want to order your list Z-A then use:
ORDER BY subject DESC
this works:
SELECT subject, sender_list, date, uid
FROM messages
WHERE folder_id = 3
ORDER BY subject ASC
but i wouldn't mind taking off the 'asc' at the end being that ASC is true by default.