I have a table and I need to get the number of rows using different criteria. I am currently using 3 queries one by one:
- SELECT COUNT (status) FROM projects WHERE project = '1'
- SELECT COUNT (status) FROM projects WHERE project = '1' AND status> '10 '
- SELECT COUNT (status) FROM projects WHERE project = '1' AND status> '20 '
How to combine these queries into one query?
PS There are 30 different statuses, so GROUP BY status is not a big choice.
source
share