I have this database and queries:
id product_id status
======================
1 25 1
2 25 1
3 25 0
4 26 1
etc.
$query1 = "SELECT COUNT(id) FROM abc WHERE product_id = '25' AND status = '1'";
$query2 = "SELECT COUNT(id) FROM abc WHERE product_id = '25'";
Basically I need to count twice:
Count products with id=25 which has status=1, and
Count products with id=25
So, in returns I would like to have result:
There's 2 good items from 3 products
Is there a simple way to have this into single query?
[!] Sorry for bad explaination :p