$ID=111;
$Status=1;
$select=mysql_query("SELECT count(*) as count from Students WHERE ID='".$ID."'AND Status='".$Status."'");
$result=mysql_fetch_array($select);
echo $result['count']
SELECT * FROM (SELECT Id,
Foo,
Bar
FROM (VALUES ('Id0', 'Foo0', 'Bar0')) AS X (Id, Foo, Bar)) AS X
INNER JOIN
(SELECT *
FROM (VALUES('Id1', 'Foo1', 'Bar1'),
('Id2', 'Foo2', 'Bar2'),
('Id3', 'Foo3', 'Bar3')) AS Y (Id, Foo, Bar)) AS Y
ON 1 = 1
select a.ID, a.count_id, COALESCE(b.one_count,0) count_1, (a.count_id - COALESCE(b.one_count, 0) ) count_0
from (select ID, count(ID) count_id from tableName group by ID) a
left join (select ID, count(ID) one_count from tableName where status=1 group by ID) b
on a.ID = b.ID