| inner query use outer query [message #636402] |
Wed, 22 April 2015 15:03  |
miroconnect@yahoo.com
Messages: 202 Registered: April 2006
|
Senior Member |
|
|
select
*
from (
select
(select 'col1' from dual where 1=dp_params.days_pending ) as col1,
(select sum(day) from (
select '1' as day from dual /*where 1=dp_params.days_pending*/
union
select '2' as day from dual /*where 1=dp_params.days_pending*/
)
) as col2
from dual qu,
(select 1 as days_pending from dual ) dp_params )
this is my query , I trying to explain my problem using simple dual select, In reality all the simple dual selects are complex one.
(select sum(day) from (
select 1 as day from dual /*where 1=dp_params.days_pending*/
union
select 2 as day from dual /*where 1=dp_params.days_pending*/
)
) as col2
in this inner query I want to use the dp_params.days_pending , is there any way I can refer to days_pending in inner query? I commented out where condition which needs filed from outer query
|
|
|
|
|
|
|
|
|
|
|
|