I am trying to do the following but am not having any luck. Is there a way to do this with one query?
Here are my tables and their fields
Table: Articles
Fields: article_id, title, date_posted, etc...
Table: News
Fields: news_id, title, date_posted, etc...
Table: Forum
Fields: forum_id, title, date_posted, etc...
Table: Comments
Fields: comment_id, section_id, category_id, comment, date_posted, etc...
A bit of information on the fields in Comments:
category_id - can be either 1, 2 or 3 (if it's 1 it relates to the Forum, 2 relates to the News and 3 relates to Articles)
section_id - connects to the primary ID "forum_id", "news_id" and "article_id" depending on what the "category_id" is.
What I want to do is return all "Forum" items (whether they have any "Comments" or not) and also all "Articles" & "News" items that HAVE comments. These would be Ordered BY date_posted in the "Comments" table (if a comment exists) OR by date_posted in the "Forum" table (since only the Forum table is one that is allowed to have no comments show up)
Anyone know if this is possible to do with one query? Sorry if I am not that clear having a hard time to explain...