我写了这个查询,但它给了我一个错误:
select c.sid
from catalog c
where exists ((select p.color from parts p)
except (select p2.color from parts p2 where p2.color != 'Red'));
ORA-00907: 缺少右括号
你能告诉我哪里不正确吗?
目录:
SID PID COST
1 3 .5
1 4 .5
1 8 11.7
2 3 .55
2 8 7.95
2 1 16.5
3 8 12.5
3 9 1
4 5 2.2
4 6 1247548.23
4 7 1247548.23
部分:
PID PNAME COLOR
1 Left Handed Bacon Stretcher Cover Red
2 Smoke Shifter End Black
3 Acme Widget Washer Red
4 Acme Widget Washer Silver
5 I Brake for Crop Circles Sticker Translucent
6 Anti-Gravity Turbine Generator Cyan
7 Anti-Gravity Turbine Generator Magenta
8 Fire Hydrant Cap Red
9 7 Segment Display Green