join - MYSQL : Problem in writing where clause according to scenario -


i have db (user_interests) set 3 fields: i_id (unique), interest_id, uid.

then second db (interests) set interests: interest_id (unique), interest_name

i'd sql query return list of interests 2 users have in common: user (owner of profile) , user b (you/viewer of profile). guess need query user_interests, join interests name of interest.

select user_interests.i_id, user_interests.uid, interests.interest_name  databases.user_interests  left join databases.interests  on interest.interest_id = user_interest.interest_id  _______________ 

i'm confused clause (if correct way @ all). goal interest_id user_interests.interests user_interests.uid both , b (in separate rows).

i saw link, couldn't figure out missing: group x y = , b , c

i don't think need clause in case remove , set of data looking for:

select user_interests.i_id, user_interests.uid, interests.interest_name  databases.user_interests  left join databases.interests  on interest.interest_id = user_interest.interest_id  

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -