Daleeburg Posted March 27, 2007 Share Posted March 27, 2007 Can this be done? If i have 4 different tables (each is a different forum category) and i would like the name of the last 5 thread updated is there a way to do this. Also is there a way to prevent repeats so that if the same thread is updated twice in a row it only shows up once in the review. Thank ~D Link to comment https://forums.phpfreaks.com/topic/44503-finding-the-newest-in-more-then-one-table/ Share on other sites More sharing options...
monk.e.boy Posted March 27, 2007 Share Posted March 27, 2007 select Max(total) from ( select 10 as total UNION select 12 as total UNION select 7 as total UNION select 44 as total ) as x Use UNION to merge all the queries into a single table. Then do a max on this new 'table'. So you'd replace SELECT 44 AS total , with SELECT max(count) from forum_category WHERE user=99 Hope that helps monk.e.boy Link to comment https://forums.phpfreaks.com/topic/44503-finding-the-newest-in-more-then-one-table/#findComment-216153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.