Re: Sql Query

From: Conan <conan_at___no-spam__dublin.com>
Date: Thu, 23 Nov 2000 11:11:46 -0000
Message-ID: <fY6T5.18131$Bw1.10611_at_news.indigo.ie>


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 - 12:11:46 CET

Original text of this message