I am trying to get data from two table order by date:
(SELECT * FROM news ORDER BY date DESC LIMIT 3)
UNION
(SELECT * FROM article ORDER BY date DESC LIMIT 3);
This return 3 items from news order by date then 3 items from article order by date:
- news 1 (2018-8-22)
- news 2 (2018-7-19)
- news 3 (2018-6-13)
- article 1 (2018-8-22)
- article 2 (2018-7-18)
- article 3 (2018-6-12)
But I want to combine data order by date like this:
- news 1 (2018-8-22)
- article 1 (2018-8-22)
- news 2 (2018-7-19)
- article 2 (2018-7-18)
- news 3 (2018-6-13)
- article 3 (2018-6-12)
Any Idea?