我有两张桌子,一张看起来像这样
Position(posNum, posTitle, posSalary)
样本数据:
insert into position values ('P0009','Systems Engineers',5600);
insert into position values ('P0010','Senior Lecturer', 9000);
insert into position values ('P0011','Database Administrator',4500);
和另一张这样的桌子
SKILL(skill,skillDesc)
样本数据:
insert into skill values ('SK009','Database Optimization');
insert into skill values ('SK010','Oracle XE 11g');
由这样的表引用
SKILLNEEDED(skillneededPosNum, skillneededSkill)
样本数据:
insert into skillneeded values ('P0009','SK010',10);
insert into skillneeded values ('P0010','SK401',10);
insert into skillneeded values ('P0010','SK807',10);
我的查询中是否有任何错误,因为它没有返回任何不应该出现的行
SELECT p.posNum, p.posTitle, p.posOfferedBy
FROM POSITION p
JOIN SKILLNEEDED c
ON p.posNum = c.skillneededPosNum
JOIN SKILL s
ON s.skill = c.skillneededSkill
WHERE s.skillDesc = 'Oracle XE 11g' AND s.skillDesc = 'Database Design';