Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> nested query syntax
hello !
here is a nested query :
// SELECT ALL ITEMNO, DESCRIPTION, OFFERED_BY, START_DATE, END_DATE,
RESERVE_PRICE
// FROM ITEMS
// WHERE RESERVE_PRICE * 2 <
// ( SELECT ALL MAX(BID) AS Project_Anonymity_0
// FROM ( SELECT ALL USERID , ITEMNO , BID , BID_DATE
// FROM BIDS
// WHERE BIDS.ITEMNO = ITEMS.ITEMNO
// )
// );
and it generates the following error message :
// WHERE BIDS.ITEMNO = ITEMS.ITEMNO
// *
// ERREUR à la ligne 7 :
// ORA-00904: invalid column name
but its equivalance works
// SELECT ALL ITEMNO, DESCRIPTION, OFFERED_BY, START_DATE, END_DATE,
RESERVE_PRICE
// FROM ITEMS
// WHERE RESERVE_PRICE * 2 <
// ( SELECT ALL MAX(BID) AS Project_Anonymity_0
// FROM BIDS
// WHERE BIDS.ITEMNO = ITEMS.ITEMNO
// );
However , these two query work well on MS SQL Server.
It seems that in oracle , a table instance (item) opened Select statement
can only be referred in its direct nested subquery,( but I can not find this
in oracle Document ) is that true ? Received on Thu Jan 03 2002 - 05:25:28 CST
![]() |
![]() |