当前位置:网站首页>面试突击62:group by 有哪些注意事项?
面试突击62:group by 有哪些注意事项?
2022-07-06 09:39:00 【InfoQ】
1.group by 后面不能加 where
- select
- from
- where
- group by
- having
- order by
- limit

- from 阶段
- where 阶段
- group 阶段
- having 阶段
- select 阶段
- order by 阶段
- limit 阶段
2.group by 或 having 可单独使用

3.group by 和 having 可使用别名
drop table if exists student_score;
create table student_score(
id int primary key auto_increment comment '主键',
name varchar(250) comment '姓名',
math decimal(4,1) comment '数学成绩',
chinese decimal(4,1) comment '语文成绩'
);
insert into student_score(name,math,chinese) values('张三',50,50),('李四',80,80),('王五',90,90);



为什么可用别名?
- from 阶段
- where 阶段
- group 阶段
- having 阶段
- select 阶段
- order by 阶段
- limit 阶段

总结
边栏推荐
- mysql高级(索引,视图,存储过程,函数,修改密码)
- Hongmeng introduction and development environment construction
- [reverse primary] Unique
- Grafana 9 is officially released, which is easier to use and more cool!
- Example of batch update statement combining update and inner join in SQL Server
- Xin'an Second Edition: Chapter 12 network security audit technology principle and application learning notes
- [reverse] repair IAT and close ASLR after shelling
- Akamai talking about risk control principles and Solutions
- Models used in data warehouse modeling and layered introduction
- Error: Publish of Process project to Orchestrator failed. The operation has timed out.
猜你喜欢

Vscode matches and replaces the brackets

FlutterWeb瀏覽器刷新後無法回退的解决方案

Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system

PyTorch 提取中间层特征?

虚拟机启动提示Probing EDD (edd=off to disable)错误

PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口

Integrated development management platform

07个人研发的产品及推广-人力资源信息管理系统

Huawei certified cloud computing hica

集成开发管理平台
随机推荐
Xin'an Second Edition: Chapter 25 mobile application security requirements analysis and security protection engineering learning notes
Grafana 9 is officially released, which is easier to use and more cool!
03个人研发的产品及推广-计划服务配置器V3.0
Sqoop I have everything you want
Vscode replaces commas, or specific characters with newlines
Example of batch update statement combining update and inner join in SQL Server
2022年大厂Android面试题汇总(二)(含答案)
Pyspark operator processing spatial data full parsing (4): let's talk about spatial operations first
[introduction to MySQL] third, common data types in MySQL
The art of Engineering
Openharmony developer documentation open source project
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
Solution qui ne peut pas être retournée après la mise à jour du navigateur Web flutter
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
Total / statistics function of MySQL
虚拟机启动提示Probing EDD (edd=off to disable)错误
MySQL Advanced (index, view, stored procedures, functions, Change password)
List set data removal (list.sublist.clear)
06 products and promotion developed by individuals - code statistical tools
2021-03-22 "display login screen during recovery" can't be canceled. The appearance of lock screen interface leads to the solution that the remotely connected virtual machine can't work normally