How can I extract the required data from these three tables using mysql? -


sorry i'm struggling work out correct sql extract required data these 3 tables...

users:- id, firstname, lastname, email, live contracts:- id, userid, contractid userstage:- id, userid, stageid, statusid 

i need firstname, lastname, email, live, users , contractid contracts, , statusid userstage

where users.live =1 , contracts.contractid = 1 , userstage.statusid <>4 (not equal 4) 

thank you.

it's pretty basic sql. don't see problem is. might want change outer join (left or right) depending on need.

select u.firstname, u.lastname, u.email, u.live, c.contractid, us.statusid users u inner join contracts c on u.id = c.userid inner join userstage on u.id = us.userid u.live = 1 , c.contractid = 1 , us.statusid <> 4 

Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -