Re: Simple SQL question.

From: Tommy Wareing <p0070621_at_oxford-brookes.ac.uk>
Date: 5 Jul 1993 03:19:17 -0500
Message-ID: <C9on1K.Exy_at_uk.ac.brookes>


JEFF CHAMBLEE (512) (chamblej_at_author.gsfc.nasa.gov) wrote:
> The following is grossly inefficient but is nice for small tables
 

> SELECT * FROM TABLE WHERE ROWNUM <= 20
> MINUS
> SELECT * FROM TABLE WHERE ROWNUM < 10
Except that the ROWNUM does not have to be the same for any given row in the two selects. The first is entitled (for example) to return the first twenty row in the table, and the second could return the next ten. Result is that you get the first twenty rows back. Or, what if some of those twenty rows are duplicates? Then the MINUS will only allow one occurrence to show.

--
 _________________________   __________________________________________
/  Tommy Wareing          \ /  I've been looking for an original sin,  \
|  p0070621_at_uk.ac.brookes  X   One with a twist and a bit of a spin    |
\  0865-483389            / \     -- Pandora's Box, Jim Steinman       /
 ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
Hello?
Received on Mon Jul 05 1993 - 10:19:17 CEST

Original text of this message