Select as a table source in SQL
277824May 18 2005 — edited May 18 2005I vaguely remember reading about an SQL feature Oracle 9.2 supports, but cant remember the syntax.
Below is an example
Here is an SQL that works...
SELECT a.col1, c.col2
FROM ( SELECT tbl1.col1
FROM tbl1, tbl2
WHERE tbl1.col2 = tbl2.col2 ) a
, tbl3 c
WHERE c.col1 = a.col1
There is alternate syntax for the same functionality that is MUCH easier to read and document when you have more complex selects involved, but I can't remember the keyword. It is something like...
KEYWORD( SELECT tbl1.col1
FROM tbl1, tbl2
WHERE tbl1.col2 = tbl2.col2 ) a
SELECT a.col1, c.col2
FROM a
, tbl3 c
WHERE c.col1 = a.col1
But I can't remember or find anywhere what KEYWORD should be.
Anyone have an idea?
Thanks,
Chris Elvart of SBC