Skip to content
Advertisement

Oracle SQL: invalid identifier error with newly computed column

I am new to Oracle SQL, and any help will be appreciated! I am trying to run this query:

I got an error message saying the Year is an invalid identifier.I am wondering how to use this newly created column (Year) to compute age.

Advertisement

Answer

You can’t reference it immediately; use the same SUBSTR, again:


Or, calculate year in a subquery, then use it in main query, e.g.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement