Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: can I put a Select in my Select?
See below ...
Mike Cohen wrote:
> Hello,
>
> I was wondering if I can nest a Select statement within my Select statement?
yes
>
> Thank you very much!
>
> Mike
>
> The code I'm trying to get work is as such:
Did you try it? Was there an error? What was it?
>
> 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"
> FROM
> claritas_mhv rcm,
> t_seller tsp,
> t_transaction ttt
> WHERE
> ttt.status in (600,700)
> 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
> GROUP BY
> rcm.MSA
-- Ron Reidy Oracle DBAReceived on Wed Feb 05 2003 - 17:25:40 CST
![]() |
![]() |