'MySQL - Averaging values from two possible columns
I have a table that looks like this:
ID SCORE OVERRIDE_SCORE
1 15 NULL
2 16 17
3 16 NULL
I am averaging the scores using:
SELECT AVG(SCORE) FROM QA
WHERE SCORE is not NULL
I would like to use the OVERRIDE_SCORE as the SCORE so that when the override score was present, the average would use that value instead of the value in SCORE.
Is that possible in a query?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
