Re: Selecting table row with latest date - Mailing list pgsql-general

From Rich Shepard
Subject Re: Selecting table row with latest date
Date
Msg-id alpine.LNX.2.20.2108190746270.15165@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Selecting table row with latest date  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, 19 Aug 2021, Tom Lane wrote:

> The best way is usually like
>
>    select * from mytable order by contact_date desc limit 1;
>
> If you have an index on contact_date this should work very well indeed.

Tom,

I don't have an index on that table. I'll add one and try you suggestion.

Thanks,

Rich



pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Selecting table row with latest date
Next
From: "David G. Johnston"
Date:
Subject: Selecting table row with latest date