请帮助解决这个问题。我尝试使用join.can在Microsoft Access 2010中解决此问题。我通过创建视图然后应用简单查询来解决此问题
这是表结构:
客户
custnum,custname,balance,repnum
订单
ordernum,partnum,numordered,quotedprice
订单
ordernum,orderdate,customernum
部分
partnum,description,onhand,class,warehouse,price
rep
repnum,佣金
答案 0 :(得分:0)
SELECT DISTINCT c.custname
FROM ((orderline AS ol
INNER JOIN [part] AS p ON ol.partnum = p.partnum)
INNER JOIN [order] AS o ON ol.ordernum = o.ordernum)
INNER JOIN customer AS c ON o.customernum = c.custnum
WHERE p.description = 'refrigerator'
答案 1 :(得分:0)
SELECT custname FROM customer WHERE custnum=
ANY(SELECT custnum FROM [order] WHERE ordernum=
ANY(SELECT ordernum FROM orderline WHERE partnum=
ANY(SELECT partnum FROM [part] WHERE description ='refrigerator')
));