我想加入三张桌子
patient_data
和employer_data
有共同字段pid
employer_data
和list_option_data
有comon字段stateAB
所以我想显示p.name, e.name, e.city, l.state
:
select
p.name,
e.name,
e.city,
l.state
from patient_data as p
inner join
/*
this part i need to know how to join these...
*/
答案 0 :(得分:0)
你编码就像你解释的那样:
select
p.name,
e.name,
e.city,
l.state
from patient_data p
join employer_data e on e.pid = p.pid
join list_option_data l on l.stateAB = e.stateAB
请注意inner
的{{1}}是多余的 - 默认联接类型为inner join