用SQL实现某表某字段为一个值时查询一个表,为另一个值时查询另一张表

2024-11-07 12:40:33
推荐回答(1个)
回答1:

select case when A.a = 2 then C.xxx else B.xxx end
from A inner join B on A.xxx = B.xx
inner join C on A.xxx = C.xxx