在使用left jion时,会生成一张中间的临时表,然后再将这张临时表返回给用户. on和where条件的区别如下:1. on条件是在生成临时表时使用的条件,它不管on中的条件是否为真,都会返回左边表中的记录.2.where条件是在临时表生成好后,再对临时表进行过滤的条件.这时已经没有left join的含义(必须返回左边表的记录)了,条件不为真的就全部过滤掉. select * form tab1 left join tab2 on (tab1.size = tab2.size) where
一.使用WHERE子句 SELECT prod_name, prod_price FROM Products WHERE prod_price = 3.49; 输出▼ prod_name prod_price ------------------- ---------- Fish bean bag toy 3.49 Bird bean bag toy 3.49 Rabbit bean bag toy 3.49 分析▼ 这条语句从products表中检索两个列,但不返回所有行,只返回prod_pr