每日小记(16 .9.7)
来源:互联网 发布:手机如何查看淘宝粉丝 编辑:程序博客网 时间:2024/06/05 07:27
关于数据库:
数据库插入语句:
insert into table (col1,col2) values (v1,v2);
去数据库前十条数据
oracle: select * from table where rownum<=10;
mysql : select * from table limit 10;
sql server : select top 10 * from table;
关于数据库 某一列要计算总数:
求学生各科成绩之和:
select t.name,sum(e.score)
from student t
join exam e
on t.no=e.no
group by t.name
关于区分成绩等级:
select t.name ,e.subject,case
when e.score>=90 and e.score<100 then 'good'
when e.score>=80 and e.score<90 then 'not good'
else 'false'
end
from exam e
join student t
on e.no=t.no
删除表中所有数据;
truncate exam;
0 0
- 每日小记(16 .9.7)
- “每日小记”之由来
- 每日小记~10~11
- 每日小记-10-12
- 0617 每日小记
- 0621 每日小记
- 每日小记(16.9.6)
- 每日小记(16.9.24)
- 每日小记 2017 2.9
- 每日小记 2017.2.14
- 每日小记 2.19
- 每日小记2017.2.20
- 每日小记2017.2.22
- 每日小记 2017.2.26
- 每日小记2017.2.28
- 每日小记2013.3.1
- 每日小记2017.3.7
- 2017.3.12 每日小记
- JAVA基础6.41——JAVA文档注释
- 向量
- android webview 自定义404错误页面!
- Android 之MediaPlayer播放背景音乐
- Myeclipse如何使用自带git工具向远程仓库提交代码
- 每日小记(16 .9.7)
- 迷宫:广度优先搜索求最短路径
- 点击事件与屏幕溢出判断
- spring中配置数据源的4种形式
- Leetcode 42 Trapping Rain Water
- 关系数据库的基本概念
- CentOS virtual vms文件夹 搬家
- (三)ArcGIS Server之发布要素服务
- 一个超强的网站,网站管理员必备