这是查询:
select STOCKS.STOCKNO, STOCKS.DESCRIPTION, ORDERITEMS.QTYORD
from STOCKS
left join ORDERITEMS
on STOCKS.STOCKNO = ORDERITEMS.STOCKNO
WHERE STOCKNO !=(Select STOCKNO from ORDERITEMS where ORDERNO='1' or ORDERNO='2')
ORDER BY STOCKNO
/
这是错误:
ORA-00918: column ambiguously defined for every stock item..
我已经完成了连接,但是对于第一个查询但是对于第二个查询是
WHERE STOCKNO !=(Select STOCKNO from ORDERITEMS where ORDERNO='1' or ORDERNO='2')
问题是显示 STOCKS、DESCRIPTION 和 Quantity Ordered,包括到目前为止尚未下订单的库存。