Re: How to just get the last in a recursive query - Mailing list pgsql-sql

From Shaozhong SHI
Subject Re: How to just get the last in a recursive query
Date
Msg-id CA+i5JwZR_XYcbU_bekoAo1rAE=6+X+je_7+4+repLztLZqxoHg@mail.gmail.com
Whole thread Raw
In response to Re: How to just get the last in a recursive query  (Rob Sargent <robjsargent@gmail.com>)
Responses Re: How to just get the last in a recursive query  (Rob Sargent <robjsargent@gmail.com>)
Re: How to just get the last in a recursive query  ("David G. Johnston" <david.g.johnston@gmail.com>)
RE: How to just get the last in a recursive query  ("Tchouante, Merlin" <mtchouan@umaryland.edu>)
List pgsql-sql
That is not the most efficient in this case.
How to tell query to deliberately miss out all except the last one is of interest.
Regards, David

On Monday, 4 April 2022, Rob Sargent <robjsargent@gmail.com> wrote:
On 4/4/22 16:14, Shaozhong SHI wrote:


---------- Forwarded message ---------
From: Shaozhong SHI <shishaozhong@gmail.com>
Date: Mon, 4 Apr 2022 at 23:13
Subject: How to just get the last in a recursive query
To: PostGIS Users Discussion <postgis-users@lists.osgeo.org>



3 rows got returns as follows:

 id
---  6  3  1

How to just get the last (namely, 1) in the most efficient way?
Regards, David
reverse the order of the last query and set limit 1

pgsql-sql by date:

Previous
From: Rob Sargent
Date:
Subject: Re: How to just get the last in a recursive query
Next
From: Rob Sargent
Date:
Subject: Re: How to just get the last in a recursive query