当前位置:网站首页>面试突击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入门】第一话 · 初入“数据库”大陆
- 虚拟机启动提示Probing EDD (edd=off to disable)错误
- Precipitated database operation class - version C (SQL Server)
- The art of Engineering (1): try to package things that do not need to be exposed
- connection reset by peer
- Flexible report v1.0 (simple version)
- [ciscn 2021 South China]rsa writeup
- Detailed explanation of data types of MySQL columns
- Flink parsing (VII): time window
- [introduction to MySQL] third, common data types in MySQL
猜你喜欢
The most complete tcpdump and Wireshark packet capturing practice in the whole network
The NTFS format converter (convert.exe) is missing from the current system
Start job: operation returned an invalid status code 'badrequst' or 'forbidden‘
PySpark算子处理空间数据全解析(5): 如何在PySpark里面使用空间运算接口
Zen integration nails, bugs, needs, etc. are reminded by nails
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
07 personal R & D products and promotion - human resources information management system
Spark calculation operator and some small details in liunx
Integrated development management platform
Basic configuration and use of spark
随机推荐
C# WinForm系列-Button简单使用
C# NanoFramework 点灯和按键 之 ESP32
02 personal developed products and promotion - SMS platform
学 SQL 必须了解的 10 个高级概念
Redis installation on centos7
Automatic operation and maintenance sharp weapon ansible Foundation
Zen integration nails, bugs, needs, etc. are reminded by nails
灵活报表v1.0(简单版)
FlutterWeb瀏覽器刷新後無法回退的解决方案
Example of batch update statement combining update and inner join in SQL Server
connection reset by peer
07个人研发的产品及推广-人力资源信息管理系统
Unity小技巧 - 绘制瞄准准心
Connect to LAN MySQL
【Elastic】Elastic缺少xpack无法创建模板 unknown setting index.lifecycle.name index.lifecycle.rollover_alias
自动答题 之 Selenium测试直接运行在浏览器中,就像真正的用户在操作一样。
Xin'an Second Edition: Chapter 26 big data security demand analysis and security protection engineering learning notes
Interpretation of Flink source code (II): Interpretation of jobgraph source code
TCP连接不止用TCP协议沟通
Solrcloud related commands