知识点整理

来源:互联网 发布:js上传图片转base64 编辑:程序博客网 时间:2024/04/28 09:42


 1.查询各科最高分 
select *,max(scode) from student group by xueke

2.查询总分前三名

select name,SUM(scode) FROM student GROUP BY name ORDER BY SUM(scode) desc limit 3

3.查询平均分前三名

select name,AVG(scode) from student GROUP BY name ORDER BY AVG(scode) desc limit 3

4.查询各科均几个的学生

SELECT MIN(scode) as mins,name from student GROUP BY name HAVING mins>=60


int a=5 b=10在不引用任何第三方变量的情况下使a    b  互换

int   a=5  b=10
a=a+b
b=a-b
a=a-b
 

或者    a^=b^=a^=b;

0 0