title: Hive - Count the number of records for each day in a DB
body: <p>I have a hive table that has millions of records and each row is a unique record that has a date - example below:</p>
  
  <pre><code>name, date, item
  bob, jan 1, brush
  jim, jan 1, computer
  mary, jan 1, mouse
  bill, jan 2, mop
  james, jan 3, desk
  </code></pre>
  
  <p>I want the output to just show me how many records there are per day. I tried:</p>
  
  <pre><code>select distinct(date), count(distinct(date)) distinct for date
  from DB
  </code></pre>
  
  <p>and</p>
  
  <pre><code>select distinct(date) from DB group by count(distinct(date))
  </code></pre>
  
  <p>I realize I can't just do count(distinct(date)) because that just gives me the number of total distinct dates. I want the output to be:</p>
  
  <pre><code>date, count
  jan 1, 3
  jan 2, 1
  jan 3, 1
  </code></pre>
  
  <p>Thanks in advance,</p>