Problem with db_select not returning records sometimes
Turns out addExpression does not return the object, just the alias of the expression. Solution:

$query = db_select('notification_queue', 'nq')
    -&gt;fields('nq', array('created_time', 'uid', 'notification_type', 'delivery_method', 'latest_time', 'earliest_time'))        
    -&gt;groupBy('uid')
    -&gt;groupBy('notification_type')
    -&gt;groupBy('delivery_method');

$query-&gt;addExpression('COUNT(*)', 'num');
$rows = $query-&gt;execute();