There is a table items ;
id --- status ------------- 1 --- 0 2 --- 1 3 --- 1 4 --- 0 5 --- 1 It is necessary ONE query, display the number of lines with the status: 0 (there are 2) and the number of lines with 1 stutsom (there are 3). Tried through UNION - but it names the fields not as it should.
SELECT count(*) AS `status_0` FROM `itemы` WHERE `status` = 0 UNION SELECT count(*) AS `status_1` FROM `itemы` WHERE `status` = 1