There is no way to do that without explicitly naming every column. This is the documentation from technet.
SQL - AVG() on * fields [duplicate]
-
29-06-2022 - |
Question
I want to average all values on a table with many fields.
My data looks like this
col1 col2 col3 ... col100
---- ---- ---- ------
1 1 1 1
2 4 8 16
3 9 27 81
And to output all the AVG() values in a query, like so:
col1 col2 col3 ... col100
---- ---- ---- ------
2 4.67 12 32.67
The following query gives an error.
SELECT AVG(*) FROM table
Is there any SQL code to AVG() all fields without explicitly naming them?
Note: Using OpenOffice Base.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow