SELECT * FROM
(SELECT forumid,threadid
FROM threadtable
WHERE modifieddate = (SELECT MAX(modifieddate) FROM threadtable)) a,(SELECT subject
FROM messsagetable
WHERE modifieddate = (SELECT MAX(modifieddate) FROM messsagetable)) b
将第一个结果与第二个结果相结合
SELECT * FROM
(SELECT forumid,threadid,modifieddate
FROM threadtable
WHERE modifieddate = (SELECT MAX(modifieddate) FROM threadtable)) a
INNER JOIN
(SELECT subject,modifieddate
FROM messsagetable
WHERE modifieddate = (SELECT MAX(modifieddate) FROM messsagetable)) b
ON a.modifieddate = b.modifieddate
将来自第一个的所有结果与具有相同修改日期的第二个结果组合在一起.
由于两个查询只返回一个结果,您很可能想要第一个建议.