sql - mysql left outer join with two conditions -


i have 2 tables, 1 user info , 1 oauth info.

i'm allowing people have multiple oauth logins per user account - have oauth table has:

id|provider|identifier|userid

i can't figure out query need, need use table find of user data have userid.

so if know provider , identifier info, can use userid on row, join on rest of data , log user in. need left join or similar?

a left join return rows if no match found. since doesn't make sense log on not user, inner join more appropriate. inner join default type, , can omit it:

select  *    oathlogins ol join    users u on      u.id = ol.id   ol.provider = 'sesame street'         , ol.identifier = 'bert' 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -