unity3D—查询基础
来源:互联网 发布:如何投诉app软件 编辑:程序博客网 时间:2024/05/18 02:17
欢迎大家关注我的日志,今天学习了查询数据库:
1.--查询全部语句:
select * from score
2.--查询部分数据
select id,name from users where name='张三'
select id,name from users where name<>'张三'
3.--去掉重复字段查询记录
select distinct name from users
4.--合并查询(合并两表中相同的字段) 类型相同
select id from users union select id from score
5.--用AS来命名列
select id as 编号,name as 姓名 from users
6.--用 = 来命名列
select 编号 =id ,姓名=name from users
select '编号' =id ,'姓名'=name from users
7.--查询空行
select id, name from users where password is null
8.--查询非空行
select name from users where name is not null
9.--使用常量列(默认值)
select name as 姓名 ,'密码' as password from users
10.--限制固定行数
select top 3 * from users
11.--返回百分之多少行
select top 50 percent * from users
12.--升序
select * from users order by id
select * from users order by id asc
13.--降序
select * from users order by id desc
14.--按多列排序(当排序的值相同时,按第二个字段排序)
select * from users order by name,id
大家不用死记硬背,仔细的观察可以发现里面的代码有很多是一样的,只要记住其中的一部分就可以,好了今天就介绍到这了,如果大家想了解的更多可以关注我们的狗刨网:http://www.gopedu.com/
- unity3D—查询基础
- unity3D—高级查询
- unity3d---数据库基础查询和连接数据库
- unity3D—GUI基础
- Unity3D学习之(基础查询和数据库连接)
- Unity3D 基础
- Unity3D基础
- mysql基础—查询
- unity3D——GUI基础2
- Unity3d——GFootball_01:基础模型创建
- 【Unity3D基础知识点】——射线
- Unity3D之高级查询
- unity3d---SQL高级查询
- unity3d--高级查询
- Android Unity3D基础
- Unity3D GUI基础
- unity3d 基础入门
- Android Unity3D基础
- [LeetCode] N-Queen
- Linux普通用户使用libusb访问usb设备的方法
- Android Manifest之<application>元素中文注释
- android studio 常用快捷键
- 云计算平台管理的三大利器Nagios、Ganglia和Splunk
- unity3D—查询基础
- Qt连接mysql解决方案
- cocostudio uiLayout控件设置颜色和透明度的方法
- Radon变换及其Matlab代码实现
- 内存对齐问题
- 深入理解Java虚拟机笔记---访问标志
- 第十六周OJ项目——有相同的数字
- IO流学习(一)
- flash 循环