So I have this query that gets me the number of failed parts in the order. for example 94 failed. However, I want to see the total amount of parts in that order. For example, 94 failed and 200 total. How can I achieve that in one query? If it's not possible how can I combine two queries in one result table?
SELECT status, COUNT(order)
FROM result
WHERE status='failed' and order = '4373'
GROUP BY status
Best Answer
For MySQL (as the question tagged):
For another DBMS (for example, for Microsoft SQL Server):