MySQL:内部联接与位置 [英] MySQL: Inner join vs Where

查看:41
本文介绍了MySQL:内部联接与位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(在mysql中)两者之间的性能是否存在差异

Is there a difference in performance (in mysql) between

Select * from Table1 T1 
Inner Join Table2 T2 On T1.ID = T2.ID

还有

Select * from Table1 T1, Table2 T2 
Where T1.ID = T2.ID

?

推荐答案

从问题49917中已接受的答案中提取出来:

As pulled from the accepted answer in question 44917:

在性能方面,它们恰好是 相同(至少在SQL Server中),但要 意识到他们正在弃用 隐式外部联接语法.

Performance wise, they are exactly the same (at least in SQL Server) but be aware that they are deprecating the implicit outer join syntax.

在MySql中,结果是相同的.

In MySql the results are the same.

我个人会明确地坚持使用联接表……这是社会上可以接受的"方法.

I would personally stick with joining tables explicitly... that is the "socialy acceptable" way of doing it.

这篇关于MySQL:内部联接与位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆