Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t86m8-0025JM-GC for pgsql-general@arkaria.postgresql.org; Mon, 04 Nov 2024 23:46:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t86m5-006XP7-V9 for pgsql-general@arkaria.postgresql.org; Mon, 04 Nov 2024 23:46:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t86m5-006XOw-JN for pgsql-general@lists.postgresql.org; Mon, 04 Nov 2024 23:46:22 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t86m2-000Dvy-65 for pgsql-general@postgresql.org; Mon, 04 Nov 2024 23:46:21 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-20ca388d242so47820175ad.2 for ; Mon, 04 Nov 2024 15:46:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730763977; x=1731368777; darn=postgresql.org; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=riC4LRr0pVsOFHVIad5/1ZNpZ62ec7okHKk8N6NOpFI=; b=YFv3PJTUFTy4rV1JkxWRPSRe3+1yQU5TY+IRwmQKLjCBDZvG/Dx9C8aMUBl5XnVYca UQVo91ggt4aRHivSJPB0Xa8KIsqDnrtD4FX92FWrbkIYOsqdNUw9tgZb+/jSvodPvSut ywtJZVOAOK6FV27alz/QPhTOufIxFW1Qq8LUwL46Ax9ASnfN/AqZX0aLaomsadZdc0j7 /w4t2W2ROUvVIUtWTu5X312ll9sBj1wL7/kCxmQ1aWL8v81ROS4Tx/6RkMqxfcNQdWxT 1ce0vWAFrHRgOeOXxUkZStthKnom/pKB25tlLdObzhKKRNaCmgHMscBZmCt1IRhrp6lX nKVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730763977; x=1731368777; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=riC4LRr0pVsOFHVIad5/1ZNpZ62ec7okHKk8N6NOpFI=; b=mC5p2KB+ZBYJjJ6D1YUIHDJ/yJZtDxq2nXuExQYUA/pC026H1FlhGM/8IoyuxLVwlA EFNUO4iBuhDd6UW+rlhvxSeJCAzivNBJ/VmywCBdI68b35HHGmEd/Z4E7xZijiQT8M5A uDnKbF8lxlpiXDoVx2L8/a5hI2F+oGOyKhmv6XzKhkDGANU3Vp8nHCbgUoYP+DP+nzXo 54JF/GhW1yeFQiB/0g3QA6Q+I7iyGQ1bm+ISIqsWYX/0OJcuDbHz5czRxUxOqFZ81VYO vLnqMzVBADf0wHu/068xWMGhX7T20GX9mxheHfSXtBFppQEQ+3GUrJveZBsdH3n3urlp GYjA== X-Forwarded-Encrypted: i=1; AJvYcCWvme19V6bVBq9JrO+d6bLxSl26BHcrFefIcdUvvDx8PTl7oav5+TFDcSDxNRzheOxe10rxW3yTlRhc5GOa@postgresql.org X-Gm-Message-State: AOJu0Yxd37W05qlg9jt5+1LtaFdH0/fcdIWy8BWrUDTt6EuO6ZE6JxCO ITFGFzp6ZJfKUqrPZfpMTFC+1Y3hNfpbvi46NMiMYX5lkBOPPAAu X-Google-Smtp-Source: AGHT+IGKBneZINmFoMOtTJNztYD//LXCYvNXaWIWzhi5grr9hRuLIzN9MusNMM/oLj10V9QtLxjiWA== X-Received: by 2002:a17:902:ce87:b0:20b:a10c:9be3 with SMTP id d9443c01a7336-2111af50fc0mr161002705ad.21.1730763977191; Mon, 04 Nov 2024 15:46:17 -0800 (PST) Received: from [2600:8801:8600:3d2:d084:5b01:300:0] ([2600:8801:8600:3d2::9]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211057d4624sm66770205ad.259.2024.11.04.15.46.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Nov 2024 15:46:16 -0800 (PST) Date: Mon, 4 Nov 2024 15:46:08 -0800 From: Guyren Howe To: "David G. Johnston" Cc: Erik Wienhold , PG-General Mailing List Message-ID: <34536f21-801c-41cb-a5ba-5389ce8201d0@Spark> In-Reply-To: References: <3ed0759d-c332-4f96-a147-499a694e9204@Spark> <56c4c567-8422-4944-81d1-2a3c2ac5c8fa@ewie.name> <4e60ede0-86a5-4900-b415-05d68ad75cb1@Spark> Subject: Re: nth_value out of more than n values returns null X-Readdle-Message-ID: 34536f21-801c-41cb-a5ba-5389ce8201d0@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="67295cc7_5491581c_11af" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --67295cc7_5491581c_11af Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Wouldn=E2=80=99t it be offset 4=5F999=5F999=3F I=E2=80=99d still like to understand why nth=5Fvalue doesn=E2=80=99t work= . On 4 Nov 2024 at 15:44 -0800, David G. Johnston , wrote: > On Monday, November 4, 2024, Guyren Howe wrote: > > I=E2=80=99m trying to get the id of the 5,000,000th record, so I can = join against it to get a name. I didn=E2=80=99t fully understand what the= docs say there. What am I missing=3F > > So just use =E2=80=9Coffset 5=5F000=5F000 limit 1=E2=80=9D.=C2=A0 Bring= ing in a window function here seems unhelpful. > > David J. > --67295cc7_5491581c_11af Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Wouldn=E2=80=99t it be offset 4=5F999=5F999=3F

I=E2=80=99d still like to understand why nth=5Fvalue doesn=E2=80=99t work= .
On 4 Nov 2024 at 15:44 -0800, David= G. Johnston <david.g.johnston=40gmail.com>, wrote:
On Monday, November 4, 2024, Guyren Howe <guyren=40gmail.com> wrote:
I=E2=80=99m trying to get the id of the 5,000,000th= record, so I can join against it to get a name. I didn=E2=80=99t fully u= nderstand what the docs say there. What am I missing=3F

So just use =E2=80=9Coffset 5=5F000=5F000 limit 1=E2=80=9D.&=23160; = Bringing in a window function here seems unhelpful.

David J.

--67295cc7_5491581c_11af--