SELECT `complete_tasks` , `all_tasks` FROM ( SELECT COUNT ( * ) AS `complete_tasks` FROM `wp_tm_tasks` WHERE `type` = ? AND `status` = ? ) `a` , ( SELECT COUNT ( * ) AS `all_tasks` FROM `wp_tm_tasks` WHERE `type` = ? ) `b` 