当前位置:网站首页>C#语言和SQL Server数据库技术
C#语言和SQL Server数据库技术
2022-07-25 09:16:00 【yushang_zhang】
模糊查询和聚合函数查询
一、用like进行模糊查询
1.like:像.......一样
2.用like可以进行模糊查询
3.模糊查询通配符
下划线_ 匹配一个字符
% 匹配任意长度的字符
[ ] 指定范围内的一个字符,[1-8] [a-z] [A-Z] [斤,包]
[^] 不在制定范围内的任意一个字符
二、在范围内查询
1.使用between.....and
a、between 20 and 30
b、between '1991-01-02' and '1992-03-05'
c、可以设置数值区间,也可以设置日期区间
d、包含开始,也包含结束
e、可以通过not between....and来设置取反操作
2.使用in查询有限范围内的数据
a、in(22,33,44)
b、in('aa','bb','cc')
c、not in(22,33,44)
三、聚合函数
1.聚合函数的作用主要是用于统计查询
2.聚合函数只返回一个数值,因此不能够直接与返回多行的列一起显示
3.sum()
4.avg()求平均值,空值会被忽略,例如:求及格学生的平均分
5.max()/ min()求最大最小值,可用于求最高分最低分
6.count()统计个数,会忽略空值,可以通过统计主键列或者count(*)实现
7.一个sql查询中可以使用多个聚合函数,例如查询班级的最高分和最低分
边栏推荐
- This ten-year content industry infrastructure company is actually an invisible Web3 pioneer
- canvas动态图片头像晃动js特效
- ActiveMQ -- kahadb of persistent mechanism
- Troubleshooting error: NPM install emojis list failed
- Write two channel (stereo) immediately Wav file
- 图解LeetCode——1184. 公交站间的距离(难度:简单)
- [buuctf-n1book][Chapter 2 advanced web]ssrf training
- How to avoid duplicate data when the database is high and distributed
- activemq--可持久化机制之JDBC的journal
- JS small game source code magic tower breakthrough Download
猜你喜欢
![[buuctf-n1book][Chapter 2 advanced web]ssrf training](/img/29/8894d04b27e0e73c4458c27bd9b935.png)
[buuctf-n1book][Chapter 2 advanced web]ssrf training

The garbage classification data set used in the excellent Yolo target detection training is shared - about 3000 labeled

API健康状态自检

360 degree drag panorama plug-in tpanorama.js

Shell脚本

2022-7-14 JMeter pressure test

Guangzhou has carried out in-depth "100 day action" to check the safety of self built commercial houses, and more than 2 million houses have been checked in two months

activemq--可持久化机制之JDBC代码

分布式一致性协议之Raft
![[STL]stack&queue模拟实现](/img/92/c040c0e937e2666ee179189c60a3f2.png)
[STL]stack&queue模拟实现
随机推荐
activemq--可持久化机制
activemq--可持久化机制之AMQ
mysql中的数据结果排名
Sort out Huawei ap-3010dn_ V2 configuration create WiFi
SSM高级整合
为什么说DAO是未来的公司形式
ActiveMQ -- leveldb of persistence mechanism
This ten-year content industry infrastructure company is actually an invisible Web3 pioneer
对称式加密与非对称式加密的对比
Disable module (attribute node) in LabVIEW
Silicon Valley class lesson 11 - official account news and wechat authorization
The operation cannot be completed because a folder or file in it is already open in another program
Shell脚本
Redis operation uses cursor instead of keys
酷炫canvas动画冲击波js特效
Leetcode组合总和+剪枝
Learn about spark project on Nebula graph
Arrange the array into the smallest number
PL/SQL工具导出sql文件所使用的命令是什么?
@Scheduled源码解析