当前位置:网站首页>SQL Server 数据库设计--SELECT语句
SQL Server 数据库设计--SELECT语句
2022-07-23 00:07:00 【51CTO】

JZGKCHINA
工控技术分享平台
在数据库中,使用最多的就是查询语句:SELECT 语句用于检索表中的数据。常用的查询语句格式如下:
解释:
DISTINCT:指定在结果中只能包含唯一行;
TOP(n):子句用于规定要返回的记录的数目。
GROUP BY:用于结合合计函数,根据一个或多个列对结果集进行分组。
HAVING:指定组或聚合的搜索条件, WHERE 关键字无法与合计函数一起使用时使用。
ORDER BY:指定查询结果的排序方式,ASC:升序,DESC:降序
1.查询基本语句
2.查询指定字段
--查询Student表中指定字段的数据

3.查询结果中使用表达式1
--字段的数据,并将StudentResult减去10后作为新的查询结果
4.查询结果中使用表达式2
5.带限定条件的查询
--查询结果中返回前 3 行分数大于80分的人
6.显示部分查询结果
7.带AND的多条件查询
8.带OR的多条件查询
9.结合AND和OR的多条件查询
边栏推荐
- 「建议收藏」常用adb操作命令详解
- 何为国债逆回购 安全吗
- [openvx] VX for basic use of objects_ reference
- Extend the maximum memory limit of canvas and the principle of browser rendering from a bug
- 生成13位条形码
- Entrepreneurial documents: how to write a reminder letter
- BS4 index objects by attribute index and name
- 322. 零钱兑换
- How do test / development programmers break through? All roads lead to Rome
- babylon.js炫酷canvas背景动画js特效
猜你喜欢

babylon.js炫酷canvas背景动画js特效

「建议收藏」常用adb操作命令详解

Extend the maximum memory limit of canvas and the principle of browser rendering from a bug

Wireshark packet capture tool basic use

【GNN报告】香港科技大学李佳:图异常检测再思考—我们究竟需要怎样的图神经网络?

Svg+js mouse hover parallax JS effect

Data analysis and privacy security become the key factors for the success or failure of Web3.0. How do enterprises layout?

打印100~200之间的素数

实操演练 | MySQL PROCESSLIST 表和 Navicat Monitor 识别慢速查询的简单方法

【云原生】风云暗涌的时代,DBA们的利刃出鞘了
随机推荐
uva1445
做对的事情,把事情做对
5 minutes to achieve wechat applet drawing QR code
【GNN报告】华为诺亚实验室周敏:曲率视角下的图数据建模与分析
[openvx] VX for basic use of objects_ array
实现 FinClip 微信授权登录的三种方案
Ali II: why do MySQL indexes use b+ trees instead of jump tables?
二叉树遍历
自定义类型详解:结构体,枚举,联合
bs4根据属性索引与名称索引对象
[openvx] VX for basic use of objects_ node
Day3 POC and exp learning Pikachu brute force cracking with token
华为再回应“清理34岁以上员工”传言,程序员如何应对“35岁危机”?
BGP实验
Merge output under different where conditions
浅谈——网络安全架构设计(三)
触发器基础知识(下)
How to prevent all kinds of affiliated fraud?
198. 打家劫舍
何为国债逆回购 安全吗