public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ankit Kumar Pandey <[email protected]>
To: Laurenz Albe <[email protected]>
To: [email protected]
Subject: Re: Todo item: distinct clause - guidance
Date: Mon, 7 Nov 2022 01:02:41 +0530
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>


On 07/11/22 00:42, Laurenz Albe wrote:
> On Sun, 2022-11-06 at 18:39 +0530, Ankit Kumar Pandey wrote:
>> I was looking for some to-do item to pick up and came across 'Implement DISTINCT
>> clause in window aggregates'. Can someone pleaseelaborate what is expectation here?
>> Do feature request still exists as DISTINCT worked as expected if we try functions
>> like avg(distinct col)?
> Whis is about window functions, like
>
>    WITH q(a,b) AS (VALUES (1, 1), (1, 1), (2, 1))
>    SELECT *,
>           count(DISTINCT a) OVER (PARTITION BY b)
>    FROM q;
>
>    ERROR:  DISTINCT is not implemented for window functions
>    LINE 3:        count(DISTINCT a) OVER (PARTITION BY b)
>                   ^
>
> Yours,
> Laurenz Albe

Thanks a lot Laurenz, I got the issue now. I was looking at aggregation 
function without windowing.

I will revisit this again.


Thanks,

Ankit







view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Todo item: distinct clause - guidance
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox