public inbox for [email protected]  
help / color / mirror / Atom feed
Todo item: distinct clause - guidance
3+ messages / 2 participants
[nested] [flat]

* Todo item: distinct clause - guidance
@ 2022-11-06 13:09  Ankit Kumar Pandey <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Ankit Kumar Pandey @ 2022-11-06 13:09 UTC (permalink / raw)
  To: [email protected]

Hi,

I was looking for some to-do item to pick up and came across /'Implement 
DISTINCT clause in window aggregates'. /Can someone please//elaborate 
what is expectation here? Do feature request still exists as //DISTINCT/ 
/worked as expected if we try functions like avg(distinct col)?/
/

Thanks,

Ankit/
/


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Todo item: distinct clause - guidance
@ 2022-11-06 19:12  Laurenz Albe <[email protected]>
  parent: Ankit Kumar Pandey <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2022-11-06 19:12 UTC (permalink / raw)
  To: Ankit Kumar Pandey <[email protected]>; [email protected]

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Todo item: distinct clause - guidance
@ 2022-11-06 19:32  Ankit Kumar Pandey <[email protected]>
  parent: Laurenz Albe <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Ankit Kumar Pandey @ 2022-11-06 19:32 UTC (permalink / raw)
  To: Laurenz Albe <[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







^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-11-06 19:32 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-06 13:09 Todo item: distinct clause - guidance Ankit Kumar Pandey <[email protected]>
2022-11-06 19:12 ` Laurenz Albe <[email protected]>
2022-11-06 19:32   ` Ankit Kumar Pandey <[email protected]>

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