我似乎无法弄清楚为什么:
SELECT `Title`.`Title`, `FirstName`, `LastName`, `Address1`, `Address2`, `Town`.`Town`, `County`.`County`, `PostalCode`, `Phone1`, `Solo`
FROM `Person`
JOIN `Title` ON `Person`.`Title` = `Title`.`id`
JOIN `Town` ON `Person`.`Town` = `Town`.`id`
JOIN `County` ON `Person`.`County` = `County`.`id`
WHERE `Person`.`Solo`='1'
ORDER BY `LastName` ASC;
返回 0 个结果,(它不应该,至少有 5 个结果,其中Solo
='1')
如果我修改它,取出所有的 JOINS:
SELECT `Title`, `FirstName`, `LastName`, `Address1`, `Address2`, `Town`, `County`, `PostalCode`, `Phone1`, `Solo`
FROM `Person`
WHERE `Person`.`Solo`='1'
ORDER BY `LastName` ASC;
我得到结果?如果我修改它以取出WHERE Person.Solo='1'
它也会给我结果,但只有 2;surley 它应该在哪里返回所有行?有人可以解释吗?
:)
注意:Solo 是一个 tinyint,它在所有记录中等于 0 或 1!