MySQL Forums
Forum List  »  PHP

Trying to get categories and relational table information in one query
Posted by: Steven B
Date: May 30, 2012 05:03PM

If I have a table of categories and a table of articles, and a relational table between them, if there any way to forma query that would 1) Get all the category records in a specific sort order (say order by the field "sorder") and also get an alias field that would indicate whether a specific article id is connected to the category records in the relational table.

In other words the query would produce rows like this:

categoriesId categoriesLabel categoryConnected2Article

where categoryConnected2Article is an indicator that the relational table has a record connecting articleId with categoriesId.

Options: ReplyQuote


Subject
Written By
Posted
Trying to get categories and relational table information in one query
May 30, 2012 05:03PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.