我想知道为什么这个查询仍然可以完美运行。我认为 WHERE 子句总是必须以WHERE
?
SELECT `persons`.*
FROM `persons`
LEFT JOIN `team_memberships`
ON (`team_memberships`.`participant` = `persons`.`id`)
JOIN `teams`
ON (`teams`.`id` = `team_memberships`.`team`)
JOIN `departments`
ON (`departments`.`id` = `teams`.`department`)
JOIN `areas`
ON (`areas`.`id` = `departments`.`area`)
JOIN `companies`
ON (`companies`.`id` = `areas`.`company`)
[NO WHERE HERE]
AND `persons`.`id` = ?