师姐代码
select /*+ MAPJOIN ( 小表) / , from 小表 left join 大表
错误原因
left join 只支持广播右表。
2022年11月15日
我的代码· select * from a left join b on(a.dt=‘’ and a.A=b.B)
错误原因 left join不能够在on 里写,会读取全量数据
正确方法 join的时候,左右两边的判断条件都可以写在join中,left join的时候,对于左边而言,要写个子查询 ,或者 写在最后的where(select * from a left join b on () where) 对于右表而言,要写在on 里,或者子查询。