MySQL Forums
Forum List  »  PHP

Re: Trying to get categories and relational table information in one query
Posted by: laptop alias
Date: June 01, 2012 01:19AM

That should be appended to your LEFT JOIN...

Something like this, although line 2 may not now be quite right...
SELECT DiSTINCT t.*
              , COALESCE(ut.user_id = ut.user_id,0) linked 
           FROM tags t 
           LEFT 
           JOIN users_tags ut 
             ON ut.tag_id = t.tag_id
            AND ut.user_id = 3;

Options: ReplyQuote


Subject
Written By
Posted
Re: Trying to get categories and relational table information in one query
June 01, 2012 01:19AM


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.