 <p>Incidentally, if less typing (well 20 characters) and better performance is your thing then consider the following:</p> <pre><code>SELECT u.name , SUM(t.minutesSpent) Total FROM users u LEFT JOIN times t ON u.id = t.user_id AND t.date BETWEEN '2015-06-03 00:00:00' AND '2015-06-03 23:59:59' GROUP BY u.name; </code></pre>