我有三个表产品,具有相同创建日期列'创建'的事件。但是,如果任何用户向任何表添加条目,则应从网页上的该特定行显示详细信息。 你能建议我,怎么做?
答案 0 :(得分:0)
SELECT *
FROM (SELECT col1, col2, date
FROM table1
ORDER BY date DESC
LIMIT 1
UNION
SELECT col1, col2, date
FROM table2
ORDER BY date DESC
LIMIT 1
UNION
SELECT col1, col2, date
FROM table3
ORDER BY date DESC
LIMIT 1) u
ORDER BY date DESC
LIMIT 1