SQL语句中 left join 后用 on 还是 where,区别大了!
浪尖聊大数据
共 1717字,需浏览 4分钟
·
2021-04-22 07:34
来自:blog.csdn.net/wqc19920906/article/details/79785424
select * from student s left join class c on s.classId=c.id order by s.id
select * from student s left join class c on s.classId=c.id and s.name="张三" order by s.id
select * from student s left join class c on s.classId=c.id and c.name="三年级三班" order by s.id
select * form tab1 left join tab2 on (tab1.size = tab2.size) where tab2.name=’AAA’
select * form tab1 left join tab2 on (tab1.size = tab2.size and tab2.name=’AAA’)
tab1.size = tab2.size
tab2.name=’AAA’
tab1.size = tab2.size and tab2.name=’AAA’
评论