1. Join keyword is to link multiple tables together
Both on and where are conditions, but the objects are different
1.1. The keyword on refers to how to connect two tables, such as: on a.name = B.name
is a row-by-row comparison, and then joined together, at which point the contents of the WHERE clause are not judged
1.2. The keyword Where is the final data that is combined for all tables, so that they do not work the same 2. Proper optimization
The keyword Where is the data that iterates through the final Union, and the result is a traversal that matches the condition, so that the lower the number of data rows in the final data, the higher the efficiency (the order of the Where condition field affects the efficiency)
Both on and where are used as conditional constraints to filter the data, so the conditions that can be used in the on statement are not put in the where
MySQL optimization-keyword join between tables on and where (01)