Re: nth_value out of more than n values returns null

From: Guyren Howe <guyren(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Erik Wienhold <ewie(at)ewie(dot)name>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: nth_value out of more than n values returns null
Date: 2024-11-04 23:46:08
Message-ID: 34536f21-801c-41cb-a5ba-5389ce8201d0@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Wouldn’t it be offset 4_999_999?

I’d still like to understand why nth_value doesn’t work.
On 4 Nov 2024 at 15:44 -0800, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, wrote:
> On Monday, November 4, 2024, Guyren Howe <guyren(at)gmail(dot)com> wrote:
> > I’m trying to get the id of the 5,000,000th record, so I can join against it to get a name. I didn’t fully understand what the docs say there. What am I missing?
>
> So just use “offset 5_000_000 limit 1”.  Bringing in a window function here seems unhelpful.
>
> David J.
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2024-11-04 23:53:30 Re: nth_value out of more than n values returns null
Previous Message David G. Johnston 2024-11-04 23:44:24 Re: nth_value out of more than n values returns null