kermitforney
Technical User
Anyway to calculate an average across a row, without using a cursor?
Ex.
col1, col2, col3, avg of columns
1, 2, 1, 1.33
Thanks,
Ex.
col1, col2, col3, avg of columns
1, 2, 1, 1.33
Thanks,
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Select PKColumn, Avg(DataColumn)
From (
Select PKColumn, Col1 As DataColumn
From Table
Union All
Select PKColumn, Col1
From Table
Union All
Select PKColumn, Col1
From Table
) As AliasName
Group By AliasName.PKColumn
Select PKColumn, Avg(DataColumn)
From (
Select PKColumn, [!]Col1[/!] As DataColumn
From Table
Union All
Select PKColumn, [!]Col2[/!]
From Table
Union All
Select PKColumn, [!]Col3[/!]
From Table
) As AliasName
Group By AliasName.PKColumn