How to sort this select by DATA?
(SELECT * FROM mensagens WHERE de = '2' && para = '1' ORDER BY data)
UNION
(SELECT * FROM mensagens WHERE de = '1' && para = '2' ORDER BY data)
Test: link
How to sort this select by DATA?
(SELECT * FROM mensagens WHERE de = '2' && para = '1' ORDER BY data)
UNION
(SELECT * FROM mensagens WHERE de = '1' && para = '2' ORDER BY data)
Test: link
(SELECT * FROM mensagens WHERE de = '2' && para = '1')
UNION
(SELECT * FROM mensagens WHERE de = '1' && para = '2')
order by data