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!

Result of an SQL query as a Column name of another query

633053Oct 30 2009 — edited Oct 31 2009
Hi Friends,

Can we use a result of a SQL Query as a column name of another table to retrieve data. If so please help me.

For eg :
I have a table where is store numbers;

select col1 from table1 where col1='5';

and i have another table where .. this value of col is a column name..

select ( select col1 from table1 where col1='5') from table2;

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2009
Added on Oct 30 2009
5 comments
6,854 views