Not really sure how Counts, sum and procents work.
I have a table with a few rows like this
id x1 x2
1 null 0
2 1 1
3 1 null
4 0 null
where i am looking for the procentage of rows that have a 1 in the x1 and x2 columns. Null rows should not be included.
so x1 procent should be 66% and x2 should be 50%
I am having trouble because i am not sure if there is a standard function that will do this, or what the most efficient way would be if one does not exist.
Its important that it is efficient because we are talking about a lot of rows and many more columns.