Re: Re: "Oracle's ROWNUM" - Mailing list pgsql-general

From Tom Lane
Subject Re: Re: "Oracle's ROWNUM"
Date
Msg-id 21527.996516732@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: "Oracle's ROWNUM"  (Barry Lind <barry@xythos.com>)
List pgsql-general
Barry Lind <barry@xythos.com> writes:
> ...  For example rownum = 2 will return
> no rows because the first row returned by the query has by definition a
> rownum of 1, but the where predicate prevents this row from being
> returned, thus it can never get to a rownum value of 2 to satisfy the
> where predicate.

So in other words, a construct accessible in the WHERE clause is defined
in terms of what happens far downstream of WHERE.  This cannot possibly
have sane behavior.  I won't even ask about join queries...

AFAICT, LIMIT/OFFSET do the same job in a much more logical fashion.
Let's stick with those, and not try to copy the more brain-dead aspects
of Oracle.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: RULE vs TRIGGER
Next
From: Peter Choe
Date:
Subject: database information