答案 0 :(得分:0)
我决定使用“LEFT JOIN”来确定这些字段是否为TREATMENT,而EQUIPMENT是外键。
因此,您有FEE值(如果存在)。
select
T1.*
,T2.FEE as TREATMENT_FEE
,T3.FEE as EQUIP_FEE
from TREAT_INFO as T1
left join TREATMENT as T2 on T2.TREATMENT = T1.TREATMENT
left join EQUIPMENT as T3 on T3.EQUIPMENT = T1.EQUIPMENT