Jump to content

Combine 2 queries...


dannyluked

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/185695-combine-2-queries/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.