Skip to content
Advertisement

SYNTAX_ERROR: line 1:1: DISTINCT in window function parameters not yet supported

I have a table below :

Blockquote

I am writing a code below to get the next timestamp using T5 and then calculate the duration. However for the last record where T5 and T6 are equal I want to fill in the average of the previous durations. However I am getting an error in doing so. What am i doing wrong?

Advertisement

Answer

You can emulate count(*) distinct with this logic:

That is, the sum of the dense ranks in ascending and descending order is the number of distinct values in the partition.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement