長話短說,我試圖讓我的網站上次更新的時間。 我的網站的主要內容存儲在四個表格中。 每個表都有一個updated_at字段。嵌套嵌套? MySQL查詢幫助
我能夠向他們嵌套查詢相結合:
SELECT (
SELECT updated_at FROM proposition ORDER BY updated_at DESC LIMIT 1
) as latest_proposition,
(
SELECT updated_at FROM product ORDER BY updated_at DESC LIMIT 1
) as latest_product,
(
SELECT updated_at FROM review ORDER BY updated_at DESC LIMIT 1
) as latest_review,
(
SELECT updated_at FROM segment ORDER BY updated_at DESC LIMIT 1
) as latest_segment
..這讓我有點像..
-------------------+-------------------+-------------------+-------------------
latest_proposition |latest_product |latest_review |latest_segment
-------------------+-------------------+-------------------+-------------------
2011-05-25 14:45:30|2011-05-25 14:37:28|2011-05-12 09:20:19|2011-05-12 09:20:19
-------------------+-------------------+-------------------+-------------------
1 row in set (0.00 sec)
我的問題是 - 如何我現在得到的最新這些領域的?獲取整個「網站上次更新」時間。
在此先感謝!
我覺得你是一個工會之後。 – Andrew 2011-05-26 10:43:40