title: Perform self join on a table when dates and doc_Types are equal
body: <p>I want to group the same doc_type on a given day together. For instance if '1099' doc_type is classified twice on 2018-12-12. I want to count them twice and display the frequency as 2. </p>
  
  <p>Here is my query. Should I perform a self join on the table with the condition WHEN doc_type and date are equal? </p>
  
  <pre><code>SELECT    cast(date_parse(date_time, '%Y/%m/%d %H:%i:%s') AS date) AS Date
          , json_array_get (doc_type, 0) AS doc_type
          , COUNT(DISTINCT doc_type) as Frequency 
  FROM "reports"."dev_operator_logs" 
  WHERE doc_type IS NOT NULL 
  GROUP BY date_time, doc_type 
  ORDER BY date_time;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/ZHDOn.png" alt="Table looks like this"></p>