title: Running count distinct over a column - Oracle SQL
body: <p>I want to aggregate the DAYS column based on the running distinct counts of <code>CLIENT_ID</code>, but the catch is <code>CLIENT_ID</code> that were seen from the previous DAYS should not be counted. How to do this in <code>Oracle</code> SQL?</p>
  
  <p>Based on the table below (let's call this table <code>DAY_CLIENT</code>):</p>
  
  <pre><code>DAY CLIENT_ID
  
  1   10
  1   11
  1   12 
  2   10
  2   11
  3   10
  3   11
  3   12
  3   13
  4   10
  </code></pre>
  
  <p>I want to get (let's call this table <code>DAY_AGG</code>):</p>
  
  <pre><code>DAYS CNT_CLIENT_ID
  
  1    3
  2    3
  3    4
  4    4
  </code></pre>
  
  <p>So, in day 1 there are 3 distinct client IDs. 
  In day 2, there are still 3 because <code>CLIENT_ID</code> 10 &amp; 11 were already found in day 1. In day 3, distinct clients became 4 because <code>CLIENT_ID</code> 13 is not found on previous days.</p>