14
06/13
left join、inner join中的on与where的区别
sql语句中left join、inner join中的on与where的区别 table a(id, type): id type ---------------------------------- 1 1 2 1 3 2 table b(id, class): id class --------------------------------- 1 1 2 2 sql语句1:select a.*, b.* from a left join b on a.id = b.id and a.type = 1; sql语句2:select a.*, b.* from a left join b on a.id = b.id where a.type = 1; sql语句3:select a.*, b.* from a left join b on a.id = b.id and b.class = 1; sql语句1的执行结果为: a.id a.type b.id b.class ---...