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

From: <mreagan_at_fast.net>
Date: 1996/03/21
Message-ID: <mreagan-2103962340400001_at_mreagan.fast.net>#1/1


In article <314E7F63.19B0_at_cps.softex.br>, Carlos Augusto Leite Netto <cnetto_at_cps.softex.br> wrote:

> Chuck Hamilton wrote:

> > >>But seriously, how can you code a SQL query to first order records
> > >>greatest to least then pick out only a pre-selected number of them
> > >>without prior knowledge of their distribution. This strikes me as
> > >>a common, even simple thing to do, but I can't see how to do it, and
> > >>I've written some pretty twisted queries.

I hope I'm not missing something, but wouldn't it be easy to open a cursor that contains the appropriate order by and then fetch records until the number you want have been retrieved?

PL/SQL can do this kind of stuff in its sleep. So can the 3GLs.

Matt... Received on Thu Mar 21 1996 - 00:00:00 CET

Original text of this message