Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

COUNT DISTINCT using OVER clause

$
0
0

@jot6278 wrote:

Hi there,

I am having trouble calculating the distinct count of IDs over a certain group of rows using the OVER clause but it doesn’t seem to take the DISTINCT keyword.

Code:

COUNT(DISTINCT COALESCE(ABC,0)) OVER (ORDER BY XYZ ROWS BETWEEN 3 PRECEDING AND CURRENT ROW)

Error:

Distinct option is invalid with OVER phrase

Thanks in advance

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles