数据库要点
来源:互联网 发布:电脑淘宝图片尺寸 编辑:程序博客网 时间:2024/05/01 16:12
--子查询:就是使用查询语句查询一列数据出来,然作为其他查询的查询条件参数来使用
--查询身高不在年龄是22岁的人的身高范围之内的信息
select * from xueshengxinxi where shengao not in (select shengao fromxueshengxinxi wherenianling =22)
select*from xueshengxinxi where shenfenzheng not in (178,161,162)
--名字叫Add的人中的年龄比no=5的Ddd的那个人的年龄大3岁的人的信息
select*from xueshengxinxi where nianling-(selectnianling from xueshengxinxi where no =5)>3 and name='Add'
--查询表中前3人的信息top(前多少行)
select top 3 *from xueshengxinxi
selectdistinct name from xueshengxinxi
--查询不重名的人信息distinct(去重)
select*from xueshengxinxi order by tizhong asc
--依表中体重为条件进行升序排序(轻在前,重在后) asc (升序)
select*from xueshengxinxi order by tizhong desc
--依表中体重为条件进行降序排序(重在后,轻在前) desc(降序)
select*from xueshengxinxi order by nianling asc,shengaodesc
--先依表中年龄进行排序当遇到想的的年龄值时再以身高为条件对相等的值进行降序排序
selectname from xueshengxinxi group by name
--建立以name为条件的分组(只能显示一列并且只有一列,对那个列分组就只显示那一列)
select*from xueshengxinxi where nianling in (22,23)
select*from xueshengxinxi where nianling=22 ornianling=23
--二者意思一样但是表达方式不同都是选出表中年龄在到之间的人
select*from xueshengxinxi where nianling not in(22,23)
--排除表中与岁的人
- 数据库要点
- 数据库教学要点
- 数据库邮件配置要点
- 数据库学习要点概述
- 数据库复习要点
- 数据库学习要点总结
- 数据库要点回顾
- django查询数据库要点
- 安装数据库注意要点
- 数据库概念要点
- 数据库复习要点
- 数据库设计要点
- 【数据库】基础知识要点
- sql 数据库性能使用要点
- 海量数据库的设计要点。
- DDB,分布式数据库,复习要点
- DDB,分布式数据库,复习要点
- 分布式数据库设计的要点
- c语言输出小数的格式问题
- iOS多线程——NSTimer
- Android疯狂猜歌游戏之---------主界面布局
- 从ffmpeg源代码分析如何解决ffmpeg编码的延迟问题
- android重写listview使用addHeaderView和addFooterView注意事项
- 数据库要点
- Tslib中触摸屏校准原理及其实现
- 使用ViewPager和布局文件完成滑动切换
- background-position(大图抠小图)
- java - JDBC - Techniques
- 第三章第七题(2)
- Intellij IDEA 编译错误
- Bayesian举例
- Laravel Lumen