当前位置:网站首页>Statistical query of SQL Server database
Statistical query of SQL Server database
2022-06-30 00:15:00 【Little brother】
Basic database table Table by :

Inquire about Table The maximum value of a field in the table , minimum value , Average, etc .
select MAX(Age) AS Maximum age ,min(Age) AS Minimum age ,avg(Age) AS Average age from Table
Query results :

Use group by Statistics query ( male / Woman ) The number of
select Sex AS Gender ,COUNT(*) AS The number of from Table1 group by Sex
Query results :

Use group by Statistics query You can also query multiple fields ( Gender and address )
select Adderss AS home ,Sex AS Gender ,COUNT(*) AS The number of from Table group by Sex,Adderss
Query results :

Use having The number of conditional statistics queries is greater than 2 People's place
select Adderss AS Address ,COUNT(*) AS The number of from Table group by Adderss having COUNT(*)>=2
Query results :

边栏推荐
- 项目一:部署 LAMP ecshop电商平台
- Analysis of common vlog parameters
- TP5查询AND和OR条件嵌套
- 复制带随机指针的链表[空间换时间--hash记录]
- Unity about failure (delay) of destroy and ondestroy
- What is flush software? Is it safe to open an account online?
- QT learning 01 GUI program principle analysis
- Three postures of anti CSRF blasting
- 将日志文件存储至 RAM 以降低物理存储损耗
- QT learning 03 birth and essence of QT
猜你喜欢

New titanium cloud service won the "2022 love analysis · panoramic report of it operation and maintenance manufacturers" cloud management platform CMP representative manufacturer

New CorelDRAW technical suite2022 latest detailed function introduction

333333333333333333333333333333

Color space conversion in video tonemapping (HDR to SDR) (bt2020 to bt709, YCbCr, YUV and RGB)

The role of VMware virtual machine

Fine grained identification, classification, retrieval data set collation
![Clone undirected graph [bfs accesses each edge but not only nodes]](/img/34/2a1b737b6095293f868ec6aec0ceeb.png)
Clone undirected graph [bfs accesses each edge but not only nodes]

Binary search tree 230 The element with the smallest K in the binary search tree 1038 From binary search tree to larger sum tree

Vulnhub target -moriartycorp

西门子低代码 9.14版本: 满足不同需求
随机推荐
vlog常用参数解析
01背包问题
Leetcode (76) -- Minimum Covering substring
Solr basic operations 7
Cloner un Graphe non recté [bfs accède à chaque bord et pas seulement aux noeuds]
EB-5 immigration in the United States reappears to be positive, and the reauthorization policy of the regional center is suspended
FPGA Development (2) -- IIC communication
克隆无向图[bfs访问每条边而不止节点]
QPainter的使用入门:绘制象棋界面
[advanced C language] special user-defined type
[advanced C language] dynamic memory management
How to write controller layer code gracefully?
剑指 Offer II 035. 最小时间差
How to realize the spelling correction function in search engine
Mysql:sql overview and database system introduction | dark horse programmer
Summary of DOM knowledge points
golang7_ TCP programming
What is IGMP? What is the difference between IGMP and ICMP?
Andorid source build/envsetup.sh 该知道的细节
Solr basic operation 11