sorkIndustries
Technical User
My table has the following columns: A boolean,B integer,C varchar(40)
I want to get a count of the true and false values in A for each combination of B and C, and the percentage of true values. For example, if the table has the following values:
A B C
true 35 bob
false 35 bob
true 28 ted
true 28 ted
false 28 bob
false 35 ted
should return:
B C True False Percent
35 Bob 1 1 50%
35 Ted 0 1 0%
28 Ted 2 0 100%
28 Bob 0 1 0%
so far I have the following query:
SELECT c,b,count(a) from myTable where a='True' group by b,c
I'm not sure where to go from here. I don't know that much SQL and I'm a little lost.
I want to get a count of the true and false values in A for each combination of B and C, and the percentage of true values. For example, if the table has the following values:
A B C
true 35 bob
false 35 bob
true 28 ted
true 28 ted
false 28 bob
false 35 ted
should return:
B C True False Percent
35 Bob 1 1 50%
35 Ted 0 1 0%
28 Ted 2 0 100%
28 Bob 0 1 0%
so far I have the following query:
SELECT c,b,count(a) from myTable where a='True' group by b,c
I'm not sure where to go from here. I don't know that much SQL and I'm a little lost.