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
Release: 2016-06-13 12:31:23
Original
1507 people have browsed it

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 />
Copy after login

<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 />
Copy after login
 

mysql
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template