I have 3 tables that look like this:
Table1
ID x y z
1 0 30 0
2 60 0 0
3 10 30 0
4 30 30 30
Table2
ID x y z
1 0 0 50
2 0 10 0
3 10 30 0
4 0 0 0
Table3
ID x y z
1 20 30 0
2 0 0 40
3 0 30 0
4 30 0 20
I want to be able to query this and return the ID with the number of columns that have more than 0 as their value in that row. So the result would look like this:
ID Count
1 4
2 3
3 5
4 5