Made a average, sql query the total number of

select score as '成绩' ,name as '姓名' from students
UNION ALL
select AVG(score) from students;

It shows the average in the last line;

 

select score as '成绩' ,name as '姓名' from students
UNION ALL
select SUM(score) from students;

It displays the total number of the last;

Guess you like

Origin www.cnblogs.com/Thenext/p/11033050.html