title: count(distinct) over (partition by... doesn't work in Oracle SQL
body: <p><img src="https://i.stack.imgur.com/wLcTV.png" alt="enter image description here"></p>
  
  <p>I want to count the <code>distinct</code> <code>day_number</code> over the past 30 days. However, the distinct function can't be used with <code>over</code></p>
  
  <p>If I delete <code>distinct</code>, it will give me the total count of the <code>day_number</code>, but <code>day_number</code> can have lots of duplicate. So that's why I want to add <code>distinct</code>.</p>
  
  <pre><code>select tr.*,
         count( distinct day_number) OVER (PARTITION BY ACCOUNT ORDER BY DAY_number range 29 PRECEDING) as result
  from table tr;
  </code></pre>
  
  <p>Can anyone please show me how to count the distinct numbers in the <code>over(partition by..)</code> statement? Thanks in advance.</p>