按日期显示几个 MySQL 表中的结果

Showing results by date from several MySQL tables

我几乎没有 table 不同类型的 post,但想在一个 Feed 中显示它们。我按日期排序 table 数据,然后使用 fetchColumn 显示它。我怎样才能将一个 table 添加到另一个,以便来自两个 table 的 post 将按日期整合并按顺序一起提取?

  $type_select_query= $dbh -> prepare("SELECT type FROM first post WHERE id = :id   ORDER BY date DESC");

通过使用 UNION:

(SELECT ... FROM t1 WHERE ...)
 UNION
(SELECT ... FROM t2 WHERE ...)
ORDER BY ...;

http://dev.mysql.com/doc/refman/5.1/en/union.html