Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid Column Name message in the subquery

964681Sep 30 2012 — edited Oct 2 2012
Hi All, I am receiving the invalid column name message in the subquery. Please help me if there is any work around or change in the query:
Sample query:

update table1 set table1.column1 =
(Select column1 from
(Select column1 from table2 where
table1.columnX = table2.columnX
order by table2.columnM desc,table2.ColumnN desc,
)
where rownum =1)


When i run the above query i am receiving the following error message:
ORA-00904:invalid column name at table1.columnx.
This column is already existing in table1 and looks like this table is not recoginzed inside of the subquery.

I am trying to update table1.column1 using the first value from table2 after ordering by table2.columnM desc, table2.columnN desc. (ColumnM and ColumnN are the Date columns which i need to perform the sorting). I am new to sql/Plsql. Thanks in Advance for help....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 30 2012
Added on Sep 30 2012
5 comments
643 views