dannyluked Posted December 19, 2009 Share Posted December 19, 2009 Hi, could someone please combine these 2 queries as they both work seperately but I need them together for a reason that is impossible to explain but I will try if it works! Query 1; SELECT forum.*, forum.id AS fid, cat.*, Deriv1.fforumcount FROM cat LEFT OUTER JOIN forum ON cat.id = forum.catid LEFT OUTER JOIN (SELECT catid, count(forum.id) AS fforumcount FROM forum GROUP BY catid) Deriv1 ON cat.id = Deriv1.catid WHERE forum.forumlevel = 5 ORDER BY forum.catid, forum.id ASC Query 2; SELECT *, SUM(replycount) FROM topics GROUP BY forumid PS. the codes both need to show the results the same way they do now so it cant be a whole new code! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/185695-combine-2-queries/ Share on other sites More sharing options...
fenway Posted December 21, 2009 Share Posted December 21, 2009 Combine how? I don't follow. Quote Link to comment https://forums.phpfreaks.com/topic/185695-combine-2-queries/#findComment-981298 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.