Can the on in the join on query statement in mysql be changed to where?
Imhu
Imhu 2021-09-14 11:06:42
0
2
1320

For example: SELECT salary.`basesalary`,salary.`titlesalary`,`name`FROM salary INNER JOIN employeeWHERE salary.`empid`=employee.`empid` AND employee.sex='male'; this can also be checked Get the correct result

Imhu
Imhu

reply all(2)
? 现在努力,未来可期!

Let’s briefly talk about the difference between on and where. The cloud server I use is Xiaoniao Cloud. On is used when generating temporary tables. Because left on will return the left table regardless of whether the filter conditions in on are true or not. records in. For records that do not meet the conditions, all fields in the right table are null. Where works after the temporary table is generated to filter the temporary table. If the condition is not true at this time, all can be filtered.

逆旅行人

Yes, the two methods are different. If there is on, the data rows will be retrieved from the employee table based on the on conditions, and then the matching will be completed. If there is where, the data will be filtered after the matching is completed.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template