Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.