It's been very long since I've looked at SQL, so I apologize in advance...
I have a simplified table with two columns shown below with its column headings:
ID bitValue 101 1 102 0 103 1
I want to write a query that will return two rows, the first a count of all rows in the table and the second a count of all rows that have bitValue set to 1. So for the above table the result of the query will be:
Is obvious how to write a separate query for each row, but I was hoping there is a trick using a single sub query or something for efficiency.