Mysql - 2 个表按 date_posted 排序

Mysql - 2 tables sort by date_posted

我的 sql

中有 2 个 table

Instagram

推特

发布的数据是 unix 时间戳。 data_posted 检索和排序的最佳方法是什么?

我想我有几个选择

如有任何关于最佳方法的想法,我们将不胜感激。

试试这个:

SELECT *
FROM (
    SELECT id, url_caption, image, '' as screen_name,'' as text,date_posted FROM instagram 
    UNION
    SELECT 0 as id, '' as url_caption, '' as image, screen_name,text, date_posted FROM twitter)
ORDER BY date_posted