| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Differences between Oracle RDBMS and MS SQL Server
Just out of idle curiosity, what is the
MSSQL Server syntax for a query like
select details of the top 3 sales reps for each division based on commission earned ?
Sample output:
Kent Fred £1,103 1st
Kent Sally £1,067 2nd
Kent Bert £967 2nd
Essex Dave £2,104 1st
Essex Lucy £1,526 2nd
Essex Mary £1,397 3rd
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk Practical Oracle 8i: Building Efficient Databases Publishers: Addison-Wesley Book bound date: 8th Dec 2000 See a first review at: http://www.ixora.com.au/resources/index.htm#practical_8i More reviews at: http://www.jlcomp.demon.co.uk/book_rev.html Niall Litchfield wrote in message <90ocpe$rkr$1_at_soap.pipex.net>...Received on Thu Dec 07 2000 - 10:48:43 CST
>max(column) or min(column)?
>
>
>--
>Niall Litchfield
>Oracle DBA
>Audit Commission UK
>"Tim Kannel" <tdkannel_at_bitstream.net> wrote in message
>news:MPG.1498d63fbe604b6d9896ae_at_news.bitstream.net...
>> In article <90liu9$862$1_at_nnrp1.deja.com>, oratune_at_aol.com says...
>>
>> > Perhaps you haven't properly written the query:
>> >
>> > select empno, dept, sal, hiredate
>> > from (select empno, dept, sal, hiredate from emp order by empno)
>> > where rownum < 11;
>> >
>> > For 8i this query will correctly return data for the top 10 empno
>> > values. I believe that makes the above a Top-N query.
>>
>> I might use that type of query if I can't find something better.
>> In my opinion, that type of query is an example of a limitation
>> in the database server. It shouldn't be that difficult to do
>> what should be a fairly simple operation.
>>
>> BTW, for my purposes I don't need a general top-n solution;
>> top 1 would be sufficient. Anyone know of another method
>> that would work at least for the top 1 case?
>>
>> --
>> Tim Kannel
>> TCAP 3.1 - Captures console I/O to a file
>> ftp://ftp.simtel.net/pub/simtelnet/msdos/sysutl/tcap31.zip
>
>
![]() |
![]() |