SQL JOIN: is there a difference between USING, ON or WHERE?

前端 未结 6 1944
渐次进展
渐次进展 2020-11-22 00:11

I was wondering if there is any difference in the way SQL performs on these join statements:

SELECT * FROM a,b WHERE a.ID = b.ID

SELECT * FROM a JOIN b ON a         


        
6条回答
  •  情书的邮戳
    2020-11-22 01:06

    The difference is readability and maintainability. SELECT * FROM a JOIN b ON a.ID = b.ID conveys your exact intent, all in the same place.

    I won't say definitively since I haven't gotten under the hood of the last query optimizer, but I'm pretty confident you're looking at a trivial difference in performance, if any.

提交回复
热议问题