Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> SQL Question
Considering the following example;
create table mytables (
table_nameschar(20),
reference char(30));
/
insert into mytables values
('TableX','first');
/
insert into mytables values
('TableY', 'second');
/
create tableTableX (
C1 char(20));
/
insert into TableX values
('Oracle Corporation');
/
I need a single query that will extract a tablename from the mytables
field and shove it into a select statement with the from table being
the result of the query on mytables. I attempted the following to
acomplish this:
select C1 from (select table_names from mytables where reference
= 'first');
This produced the following output:
select C1 from (selecttable_names from mytables where reference
= 'first')
*
ERROR at line1:
ORA-00904: invalid column name
How is this accomplished and what did I do wrong?
LSleve
Sent via Deja.com
http://www.deja.com/
Received on Thu Dec 14 2000 - 16:09:48 CST