select distinct y.cid from orders x, orders y where y.pid = x.pid and x.aid = 'a06'; ~~~~~~~~~~~~以前沒見過同一個表 兩次
原來要實現(xiàn)的目的是: get cid values of customers who order a product for which an order is also placed by agent a06. ~~關(guān)鍵就是這個詞了 ps:幾個表 customers cid cname city discnt product pid pname city quantity price agents aid aname city percent orders ordno month cid aid pid qty dollars