on,where

       When the database returns records by connecting two or more tables, it will generate an intermediate temporary table, and then return this temporary table to the user.

      When using left jion, the difference between on and where conditions is as follows:

1. The on condition is the condition used when generating the temporary table. It will return the records in the left table regardless of whether the condition in on is true or not.

2. The where condition is to filter the temporary table after the temporary table is generated. At this time, there is no meaning of left join (the records of the left table must be returned), and all the conditions are filtered out if the conditions are not true.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326993581&siteId=291194637