有两表a和b,前两字段完全相同:(id int,name varchar(10)...)
id name
----------- ----------
1 a
2 b
3 c
以下的查询语句,你知道它的运行结果吗?:
1.
select * from a left join b on a.id=b.id where a.id=1
2.
select * from a left join b on a.id=b.id and a.id=1
3.
select * from a left join b on a.id=b.id and b.id=1
4.
select * from a left join b on a.id=1
结果:
id name id name
----------- ----------- ----------- -----------
1 10 1 10