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!

Reference field from a select within select

523585Jun 24 2008 — edited Jun 24 2008
I have a query that I am trying to create where a field is described through another select in the query. For example:

SELECT id, (select flavor from icecream where id = 1)
FROM person

----------------------------------------------------------------------------------

however in the WHERE clause I want to reference the flavor field like this:

instr(upper("id"),upper(nvl(:P1_REPORT_SEARCH,"id"))) > 0
instr(upper("flavor"),upper(nvl(:P1_REPORT_SEARCH,"flavor"))) > 0


However the id is fine, but the flavor field gives invalid identifier error. Does anyone know a work around?

I'd really appreciate any help. Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2008
Added on Jun 24 2008
5 comments
951 views