title: Single or multiple queries
body: <p>I have 3 table. I need to output the results from all three but group them by date and show a count of records per day.</p>
  
  <p>The tables are:</p>
  
  <pre><code>business_actions
  ----------------
  id
  article_id
  business_id
  action
  
  
  articles
  ----------------
  id
  user_id
  item
  date 
  time
  
  users
  ------------------
  id
  name
  role
  </code></pre>
  
  <p>I am not sure if I should try and get this all into a single query of run a query where I will get distinct dates and total record counts and then run additional queries to retrieve additional information?..</p>
  
  <p>I started with this but did not get too far.</p>
  
  <pre><code>SELECT
        COUNT(business_actions.id) AS cnt,
        business_actions.action,
        articles.user_id,
        articles.item,
        articles.date,
        articles.time,
        users.*
  FROM business_actions
  LEFT JOIN articles ON (business_actions.article_id = articles.id)
  LEFT JOIN users ON (articles.user_id = users.id)
  WHERE business_actions.business_id = ".$busID."
  ORDER BY articles.time DESC
  GROUP BY articles.date      
  LIMIT 20 
  </code></pre>
  
  <p>Limit actually should be the number of days, and not records...</p>
  
  <p>The final result should look something like:</p>
  
  <pre><code>July 20, 2015 (2)
      Some item -- 10:00 am
          Name: John M
          Role: Admin
          Action: login
  
      Another Item -- 10:30 am
          Name: Jeff M
          Role: User
          Action: publish
  
  July 18, 2015 (3)
      Some item -- 2:00 am
          Name: Bill M
          Role: User
          Action: print
  
      Another Item -- 10:30 am
          Name: Bob W
          Role: Manager
          Action: exit
  
      One more item -- 2:00 pm
          Name: William N
          Role: User
          Action: logout
  </code></pre>
  
  <hr>
  
  <p>UPDATE: Here's <a href="http://sqlfiddle.com/#!9/4817d/1" rel="nofollow">Fiddle</a> based on Barmar's answer below.</p>