I need to use a value from previous query result in the second query while using with clause
example
with xtable as (
select t1.column1,
t1.column2,
t1.column3,
t1.column4
from table1 t1
where t1.column1 in (1,2)
and t1.column4 = 'ut'
), ytable as
(
select t2.column1,
t2.column2,
t2.column3,
t2.column4
from table1 t2
where t2.column4 = xtable.column2
)select * from xtable,ytable