SELECT LIMIT and the last rows of a query

From: mathprof(at)bigfoot(dot)com
To: pgsql-general(at)postgreSQL(dot)org
Subject: SELECT LIMIT and the last rows of a query
Date: 2000-02-19 22:57:24
Message-ID: 200002192300.RAA14820@ogopogo.flash.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The command:

SELECT (query) LIMIT m,n

gives m rows of the query's response, starting at row n+1, while

SELECT (query) LIMIT m

gives the first m rows of the query's response (starting at row 1).

Is there any easy way to get the *last* m rows of a query? I tried:

SELECT (query) LIMIT 5, -5

in an attempt to get the last 5 rows, but this gives a parser error. Any
other thoughts?

Browse pgsql-general by date

  From Date Subject
Next Message Tom 2000-02-19 23:05:12 Backend terminated abnormally error ?
Previous Message Tom 2000-02-19 22:55:43 Backend terminated abnormally error ?