| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> can I put a Select in my Select?
Hello,
I was wondering if I can nest a Select statement within my Select statement?
Thank you very much!
Mike
The code I'm trying to get work is as such:
SELECT
rcm.MSA,
count(ttt.transaction_id),
sum(ttt.SALE_PRICE),
round((select
sum(ttt3.SALE_PRICE)
from
t_transaction ttt3
t_seller tsp3
where
ttt3.close_ts != 0
and tsp3.create_ts > 1004601600
and tsp3.create_ts < 1038733200
and tsp3.id=ttt3.id
)
/
(select
count(ttt2.transaction_id)
from
t_transaction ttt2,
t_seller tsp2
where
ttt2.d_actual_close_ts != 0
and tsp2.create_ts > 1004601600
and tsp2.create_ts < 1038733200
and tsp2.id=ttt2.id
)
) "AVERAGE"
and ttt.property = 'S' and tsp.create_ts > 1004601600 /* 11.1.01 */ and tsp.create_ts < 1038733200 /* 11.1.02 */ and rcm.msa is not null and rcm.zip_code=tsp.ZIP_CODE and tsp.id=ttt.id
![]() |
![]() |