title: DISTINCT COUNT per day sql
body: <p>I want to be able to COUNT DISTINCT IPs per day and then COUNT them all together.</p>
  
  <p>Basically Monday I get 3 distinct IPs and out of those 3, two of them visited the page twice so I have a total of 5 records. On Tuesday I get 1 IP that was from Monday and 2 new distinct IPs. I want to be able to count 3 distinct IPs for Monday and 3 distinct IPs for tuesday and add them all together totaling 6 records. Here is my code:</p>
  
  <pre><code>SELECT *, COUNT(DISTINCT track.ip) AS tracks
  FROM user, track
  WHERE track.user_id = $user_id
  GROUP BY $user_id
  ORDER BY tracks
  LIMIT 1
  </code></pre>
  
  <p>How can I COUNT my DISTINCT ips? </p>