Re: [Q] Daves's top 10 SQL question

From: Gerard H. Pille <ghp_at_infosoft.be>
Date: 1996/03/25
Message-ID: <4j6uh1$l7s_at_news.Belgium.EU.net>#1/1


In article <NEWTNews.827736760.23046.elric_dm_at_dialup.netvision.net.il>, Yoram zilberberg (elric_dm_at_netvision.net.il) says...
!>
!>
!>here is a possible answer:
!>select <column>[,<column>]
!>from table[,table]
!>where rownum < 11
!>order by <order_columns>
!>
!>so you see, oracle will retreive all the rows (order by does that)
!>but you will get just the first ten.
!>note that you can still use group by etc.
!>
!>how-ever, the real thing can be to define a cursor from that select
!>and tehn fetching just the first 10 (in Pro*C it will be just
!>one fetch, in Pl/Sql you'll have to work a bit harder)
!>
!>good luck
!>
!>

I'm afraid you're wrong, Yoram. It will fetch the first ten rows and order those.

-- 
Kind reGards
     \ /   |
      X    |
     / \   s
     Gerard
Received on Mon Mar 25 1996 - 00:00:00 CET

Original text of this message