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
would combine all the results from the first with all the results of the second
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
I would combine all the results from the first, with all the results of the second, which have the same changes.
Since both queries return only one result, you most likely want the first sentence.
source share