Question
· Jul 19, 2017

Using WHERE clause on a sub-query populated column

Hi,

Is it possible to use the value of a column that is populated by its own subquery,  in the WHERE clause of the outer-query ?

The following fails (it does not parse syntactically):

SELECT A, B, (SELECT S1 FROM Table2) "C" FROM Table1 WHERE C>10

I guess I could wrap it up as in inner query of it's own - this way (which works) :

Select * from 
(SELECT A, B, (SELECT S1 FROM Table2) "C" FROM Table1)
where C>10

but I was wondering if there was some syntax in the original snippet that I could do instead.

Thanks - Steve

Discussion (3)2
Log in or sign up to continue