Why LIMIT and OFFSET are commutative

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Why LIMIT and OFFSET are commutative
Date: 2007-11-25 13:39:59
Message-ID: fic6qu$sn9$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I found that

SELECT * FROM foo
ORDER BY bar
OFFSET n
LIMIT m

and

SELECT * FROM foo
ORDER BY bar
LIMIT m
OFFSET n

produce always same results.

Why ?
OFFSET and LIMIT operations are NOT commutative in general.

Andrus.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-11-25 16:21:21 Re: Problems with PostGreSQL and Windows 2003
Previous Message Hannes Dorbath 2007-11-25 13:00:08 Re: Migrating from 32 to 64 bit