Im trying to select rows from a table, union the result with another select statement and then order that by timestamp. Unfortunately it only orders the second select statement with this command:
SELECT message, transmitter_ename , Timestamp, didread FROM messages WHERE transmitter_ename= ? AND receiver_ename= ? UNION ALL SELECT message,transmitter_ename , Timestamp, didread FROM messages WHERE transmitter_ename= ? AND receiver_ename=? ORDER BY Timestamp ASC
I tried to use brackets but SQLite doesn't accept those(Error undefined).
I couldn't find anything related to that on the web.
Cheers, Valentin
Aucun commentaire:
Enregistrer un commentaire