In SQL / MySQL, what is the difference between “ON” and “WHERE” in a join statement?

前端 未结 6 1939
臣服心动
臣服心动 2020-11-27 13:23

The following statements give the same result (one is using on, and the other using where):

mysql> select * from gifts INNER JOI         


        
6条回答
  •  情书的邮戳
    2020-11-27 13:49

    If you're using a JOIN, you need to specify the conditions you are joining on. That list goes in an ON clause. A WHERE clause is used to condition data for anywhere in the query.

提交回复
热议问题