Home >Backend Development >PHP Tutorial >mysql 请教where a.id=b.id 和join on a.id=b.id 在效率上的区别

mysql 请教where a.id=b.id 和join on a.id=b.id 在效率上的区别

WBOY
WBOYOriginal
2016-06-13 11:42:46974browse

mysql求助 请问where a.id=b.id 和join on a.id=b.id 在效率上的区别
下面是ecshop 的商品表和品牌表的查询,请问它们的查询效率有什么区别呢? 
还有一个问题是 left join 和join的效率哪个高一点呢。
谢谢 !!

<br />SELECT a.`goods_id` , a.`goods_name` , b.brand_name<br />FROM  `ecs_goods` AS a<br />LEFT JOIN ecs_brand AS b ON a.`brand_id` = b.`brand_id` <br />

<br />SELECT a.`goods_id` , a.`goods_name` , b.brand_name<br />FROM  `ecs_goods` AS a, ecs_brand AS b<br />WHERE a.`brand_id` = b.`brand_id`<br />
 

mysql
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn