left join on 后面可以加where吗

2025-04-22 09:57:17
推荐回答(2个)
回答1:

可以的
-- 不加 where 
select * from table_a a left join table_b b 
on a.id = b.id 
-- 加 where
select * from table_a a left join table_b b 
on a.id = b.id 
where a.class ='one'

回答2:

select *
from a left join b on a.id=b.id and a.sid=b.sid
where xxxxxx
只有这样的用法