1
studentname I II
Vivek Johari 30 20
Chandra Singh 30 20
Avinash Dubey 30 25
Pankaj Kumar 33 29

我有一张名为 student 的桌子,上面有详细信息。我想找到第一列和第二列的平均值,并使用数据透视将其显示在新列上。请帮助我使用枢轴解决这个问题。我可以使用任何子查询来使用枢轴解决这个问题吗?

4

1 回答 1

1

your questions is not specific enough. Do you want the total average of both columns? just do

select avg (I), avg(II)
from your_table

if you want just one value, you can do:

select (avg (I) + avg(II))/2
from your_table
于 2012-04-25T10:27:38.143 回答