Skip navigation links

MySQL Forums :: PHP :: Trying to get categories and relational table information in one query


Advanced Search

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
Trying to get categories and relational table information in one query Steven B 05/30/2012 05:03PM
Re: Trying to get categories and relational table information in one query Peter Brawley 05/30/2012 08:20PM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 12:32AM
Re: Trying to get categories and relational table information in one query laptop alias 05/31/2012 01:52AM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 02:43AM
Re: Trying to get categories and relational table information in one query laptop alias 05/31/2012 03:47AM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 03:56PM
Re: Trying to get categories and relational table information in one query laptop alias 05/31/2012 05:21PM
Re: Trying to get categories and relational table information in one query Steven B 05/31/2012 06:34PM
Re: Trying to get categories and relational table information in one query laptop alias 06/01/2012 01:19AM
Re: Trying to get categories and relational table information in one query Steven B 06/01/2012 03:50AM
Re: Trying to get categories and relational table information in one query laptop alias 06/01/2012 07:28AM
Re: Trying to get categories and relational table information in one query Steven B 06/02/2012 01:13AM
Re: Trying to get categories and relational table information in one query Barry Galbraith 06/01/2012 06:52PM


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.