I am trying to select two data sets from the same table, instead of doing two queries I am trying to select them both in one call.
First of all I want to:
SELECT COUNT(*) AS `total` FROM `Messages` WHERE `id` = '1';
and the second is:
SELECT COUNT(*) AS `total_read` FROM `Messages` WHERE `id` = '1' AND `read` = '1';
Is there anyway to do this in one query?
1 Answer