select * from ( selectclass 班级,subject,avg(grade) avg_gradefrom student_score group by class,subject) pivot (sum(avg_grade) for subject in ('语文', '数学','英语')) order by 班级 asc 求班级平均分select 学科,平均分 别名 from 表where class="121"就是group by 班级,平均分 1.121班的…
select )) h, )) m, )) s from gat_data_record gdr where gdr.enddt between to_date('2011-1-1','yyyy-mm-dd') and to_date('2014-2-1','yyyy-mm-dd') 1.获得时间差毫秒数: select ceil((To_date('2008-05-02 00:00:00' , 'yyyy-mm-dd hh24-mi-ss') - To_date('2008-04-30 23:…
--根据每个部门来统计部门工资总和 select deptid, sum(sal) 工资合计 from emp group by deptid; --根据每个部门来统计部门工资总和select deptid, 工资合计, sum(工资合计) over() as 总合计 from (select deptid, sum(sal) 工资合计 from emp group by deptid) x; select deptid 部门, 工资合计, 总…
Console.WriteLine("请输入学生人数:"); int n=int.Parse(Console.ReadLine()); ArrayList arr= new ArrayList(); ; i <n; i++) { Console.WriteLine(); arr.Add(int.Parse(Console.ReadLine())); } foreach(int a in arr) { Console.Write(a+"\t"); } Conso…
import random alist = [random.randint(45,101) for _ in range(10)] #在[45.101)之间生成10个随机数 print(alist) sum = 0 for i in alist: sum = sum + i ave = sum / len(alist) print(ave)…