Sort select by date

0

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

    
asked by anonymous 28.07.2017 / 03:07

1 answer

3
(SELECT * FROM mensagens WHERE de = '2' && para = '1')
UNION
(SELECT * FROM mensagens WHERE de = '1' && para = '2')
order by data
    
28.07.2017 / 03:17