Re: Limiting Record Recovery to =< 10

From: Helen Lenhan <helen.lenhan_at_gtedc.gte.com>
Date: 1996/06/18
Message-ID: <31c6f8c1.712668331_at_internet>#1/1


On 14 Jun 1996 23:23:11 -0400, dougstand_at_aol.com (Doug Stand) wrote: In SQL you would just use ROWNUM ex:
  SELECT name, address from employee_table where name='JONES'

                and rownum < 11;

This will give you first 10 records with name = 'JONES'
>How do you set up a limit counter for row retrieval in SQL, without PL? I
>want to recover any number of rows, up to 10, of various data inputs done
>by a group of about 100+ people, each individual given a unique indexed
>USER_ID. I have no problem getting all of their row entries, even with
>the other constraint that I only want records joined to tables that have
>certain column values that aren t null. If I had the tools of other
>programming languages, I d just embed the query inside a counter-loop that
>would increment up until 10 records for each USER_ID were returned, or
>the index was completely searched, resulting in some number of rows less
>than 10. SQL, at least with my tools for Oracle, doesn t seem to have
>this counter-loop power. The tool I have uses the ROWNUM as a kind of
>global limit recovery, so 10<ROWNUM per each USER_ID doesn t seem easily
>available or useful. I'm uncertain about the approach in pure SQL.
>Anyone?
Received on Tue Jun 18 1996 - 00:00:00 CEST

Original text of this message