title: Is it possible to sql count() only the first instances of a column value?
body: <p>I would like to count the number of <em>initial</em> company subscribes for each user. </p>
  
  <p>In the dataset below, I want a count of <code>3</code> for user1 and a count of <code>0</code> for user2.  Because both of the companies subscribed by user2 had previously been subscribed by user1.</p>
  
  <pre><code>id    user    companyId    activity 
  -----------------------------------   
  
  1     1       101          subscribe
  2     1       101          unsubscribe
  3     1       102          subscribe
  4     1       103          subscribe
  
  5     2       102          unsubscribe
  6     2       102          subscribe
  7     2       103          unsubscribe
  8     2       103          subscribe
  </code></pre>
  
  <p>Is this possible in SQL, and if so, how would I go about it?</p>
  
  <p>Any improvements to question wording would be welcome as I've struggled to explain this clearly.</p>