select PC.* from PC join buss on pc.type=buss.type where buss.name='a'
还有笔记本呢? 别用union啊
select select PC.* from PC inner join buss on pc.type=buss.type where buss.name='a' select * from PC where type in (select type from buss where name='a') select name from buss where type in(select type from pc) and type not in (select type from Laptop)
select * from buss join(select type from pc except select type from laptop ) t on buss.type =t.type
SELECT * FROM BUSS A , ( SELECT * FROM PC UNION ALL SELECT * FROM Laptop) B WHERE A.TYPE=B.TYPE AND A.name = 'a'
SELECT * FRPM BUSS B WHERE EXISTS(SELECT 1 FROM PC WHERE TYPE=B.TYPE) AND NOT EXISTS(SELECT 1 FROM LAPTOP WHERE TYPE=B.TYPE)
from PC
join buss on pc.type=buss.type
where buss.name='a'
from PC
inner join buss on pc.type=buss.type
where buss.name='a'
select * from PC where type in (select type from buss where name='a')
select name from buss where type in(select type from pc)
and type not in (select type from Laptop)
buss
join(select type from pc
except
select type from laptop
) t on buss.type =t.type
(
SELECT * FROM PC
UNION ALL
SELECT * FROM Laptop) B WHERE A.TYPE=B.TYPE AND A.name = 'a'
WHERE EXISTS(SELECT 1 FROM PC WHERE TYPE=B.TYPE)
AND NOT EXISTS(SELECT 1 FROM LAPTOP WHERE TYPE=B.TYPE)