Problem solve Get help with specific problems with your technologies, process and projects.

Invalid identifier error

Can anybody help me with this?: ERROR at line 5: ORA-00904: "MAXAWARDS"."ROLE": invalid identifier

Can anybody help me with this?
SQL> select f.role from filmography
  2  ,
  3  (select max(awards) as maxiawards,username from filmography
  4  group by username)maxawards
  5  where f.role=maxawards.role
  6  and filmography.awards=maxawards.maxiawards;
where f.role=maxawards.role
ERROR at line 5:
ORA-00904: "MAXAWARDS"."ROLE": invalid identifier
In your query, you are using an "inline view" to pull data and the results of this inline view are known as the table MAXAWARDS. Here is the part of your query that denotes the inline view:
(select max(awards) as maxiawards,username from filmography 
group by username)maxawardsc
Your MAXAWARDSC view only contains the MAXIAWARDS and USERNAME columns. Yet in line 5, you are looking for the ROLE column of this view. Since this column does not exist, you get the error. You'll have to include the ROLE column in the inline view.
This was last published in May 2006

Dig Deeper on Oracle and SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.