当前位置:网站首页>面试突击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 阶段
总结
边栏推荐
- Automatic operation and maintenance sharp weapon ansible Foundation
- Xin'an Second Edition; Chapter 11 learning notes on the principle and application of network physical isolation technology
- Solrcloud related commands
- 远程代码执行渗透测试——B模块测试
- Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
- 视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
- [reverse primary] Unique
- MySQL Advanced (index, view, stored procedures, functions, Change password)
- 05 personal R & D products and promotion - data synchronization tool
- MySQL报错解决
猜你喜欢
Optimization of middle alignment of loading style of device player in easycvr electronic map
JUnit unit test
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
The problem of "syntax error" when uipath executes insert statement is solved
Development and practice of lightweight planning service tools
05 personal R & D products and promotion - data synchronization tool
CTF reverse entry question - dice
Kali2021 installation and basic configuration
FlutterWeb浏览器刷新后无法回退的解决方案
视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
随机推荐
Precipitated database operation class - version C (SQL Server)
PyTorch 提取中间层特征?
[VNCTF 2022]ezmath wp
Development and practice of lightweight planning service tools
Basic configuration and use of spark
The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
Xin'an Second Edition: Chapter 23 cloud computing security requirements analysis and security protection engineering learning notes
Connect to LAN MySQL
06 products and promotion developed by individuals - code statistical tools
Hongmeng introduction and development environment construction
mysql高級(索引,視圖,存儲過程,函數,修改密碼)
Automatic operation and maintenance sharp weapon ansible Playbook
Debug xv6
Debug and run the first xv6 program
MySQL error reporting solution
【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
[reverse intermediate] eager to try
How uipath determines that an object is null
The NTFS format converter (convert.exe) is missing from the current system
[getting started with MySQL] fourth, explore operators in MySQL with Kiko