public inbox for [email protected]  
help / color / mirror / Atom feed
From: Rob Sargent <[email protected]>
To: [email protected]
Subject: Re: Change detection
Date: Fri, 9 Dec 2022 12:38:07 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+i5JwZccb-d8qh+5_R6LfXzT2qggKbrTosp5veqqqfNjosioA@mail.gmail.com>
References: <CA+i5JwZ+XmOF6P4Lo=UTVUJBSQN4EyQL-fe7t4XTLPB9bwq9aQ@mail.gmail.com>
	<CAB-JLwZCEZNs_2jpd1UxRhC1=L3X0VeubokhQ5QBvhz3RckcZA@mail.gmail.com>
	<CA+i5Jwbi6GVDT5d_HUTpQ+RMupjCm4hR4RkojLVgZPdv96LsmQ@mail.gmail.com>
	<CAB-JLwa2voYyJUmzfanAJzvi0oW4SqEeQd5K2iO8bA_N8PE+nA@mail.gmail.com>
	<CA+i5JwZccb-d8qh+5_R6LfXzT2qggKbrTosp5veqqqfNjosioA@mail.gmail.com>

On 12/9/22 12:32, Shaozhong SHI wrote:
> That works well.
>
> I just wonder whether we can tell Tom or Tim has worked in more than 1 
> department.  Apparently, PostgreSQL does not allow count(distinct 
> department) when window function is used.
>
> Given this data set, can we do something like count(distinct) to 
> provide an answer to how many different department someone has worked in?
>
> Regards,
>
> David
Use the working query in a CTE and simply do the count(distinct 
department) on that, else there's no good place to put the number of 
departments per person.

Pretty sure you've been asked before but Please don't top post.







view thread (8+ 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]
  Subject: Re: Change detection
  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