Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sql Query
this is one of those questions where the version of Oracle makes a big difference to the syntax of the query. AFAIK order by in a subquery is not supported until 8i, so just in case here is a version 7 answer
select
t1.id,
t1.value
from orders t1,
orders t2
where t1.value <= t2.value
group by
t1.id,t1.value
having count(t2.id) =4
HTH Conan
Mark Sheng wrote in message <3A1BFBC9.B1865D1_at_forcorp.com>...
>also how about this one:
>
>select * from (select total,rownum row_num from (select distinct total from
>emp order by total desc)) where row_num=4;
>
>Mark
>
Received on Thu Nov 23 2000 - 05:11:46 CST