Ask the Expert

Invalid identifier error

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

    Requires Free Membership to View

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 first published in May 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: