当前位置:网站首页>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 :

边栏推荐
- Solr basic operation 6
- Summarize Flink runtime architecture in simple terms
- 多数元素II[求众数类之摩尔投票法]
- 云原生爱好者周刊:炫酷的 Grafana 监控面板集合
- label问题排查:打不开标注好的图像
- FPGA Development (1) -- serial port communication
- Web APIs environment object - dark horse programmer
- 项目一:部署 LAMP ecshop电商平台
- What is IGMP? What is the difference between IGMP and ICMP?
- 请指教同花顺软件究竟是什么?究竟网上开户是否安全么?
猜你喜欢

Zhongang Mining: Fluorite helps the construction and development of lithium battery in fluorine industry

QT learning 06 widgets and window types

QT learning 07 coordinate system in QT

Serialization of binary tree 297 Serialization and deserialization of binary tree 652 Find duplicate subtrees

Activity invitation | the Apache Doris community essay and speech solicitation activity has begun!

Zhongkang holdings opens the offering: it plans to raise HK $395million net, and it is expected to be listed on July 12

AI chief architect 9- huxiaoguang, propeller model library and industry application

MySQL functions and constraints

Siemens low code platform connects MySQL through database connector to realize addition, deletion, modification and query
![[Shangshui Shuo series] day 8](/img/66/2aaa82f122612db1775bdd45556d97.png)
[Shangshui Shuo series] day 8
随机推荐
After crossing, she said that the multiverse really exists
西门子低代码平台通过Database Connector 连接Mysql 实现增删改查
Exploration and Practice on the future direction of byte cloud database
MySQL:SQL概述及数据库系统介绍 | 黑马程序员
[advanced C language] string and memory function (II)
vlog常用参数解析
[advanced C language] address book implementation
Code analysis platform sonarqube actual combat
蛇形矩阵(数组模拟方向, d代表转弯)
label问题排查:打不开标注好的图像
The role of VMware virtual machine
Leetcode (680) -- verifying palindrome string II
Zhongang Mining: Fluorite helps the construction and development of lithium battery in fluorine industry
Koa2 learning and using
JS draw polar color gradient
AI首席架构师9-胡晓光 《飞桨模型库与行业应用》
Will the flush SQL CDC parallelism affect the order? Generally, only 1 can be set for data synchronization.
js中的事件
500 error occurred after importing skins folder into solo blog skin
请指教在线开户是什么意思?另外想问,现在在线开户安全么?