I have the following MySQL table
Id | One | Two | Three
----------------------------
1 | 10 | 30 | 20
2 | 50 | 60 | 20
3 | 60 | NULL | 40
Edit: Of course, the default for the table should not be NULL, but I do not want it to affect the average value (therefore, the average value is calculated as 50, not 33.33).
I want it to look like this: with a MySQL query:
Id | Average
------------
1 | 20
2 | 43,33
3 | 50
What is the most effective way to achieve this?
source
share