当前位置:网站首页>Interview shock 62: what are the precautions for group by?
Interview shock 62: what are the precautions for group by?
2022-07-06 17:48:00 【InfoQ】
1.group by Can't add after where
- select
- from
- where
- group by
- having
- order by
- limit

- from Stage
- where Stage
- group Stage
- having Stage
- select Stage
- order by Stage
- limit Stage
2.group by or having Can be used alone

3.group by and having You can use aliases
drop table if exists student_score;
create table student_score(
id int primary key auto_increment comment ' Primary key ',
name varchar(250) comment ' full name ',
math decimal(4,1) comment ' Math scores ',
chinese decimal(4,1) comment ' Chinese achievement '
);
insert into student_score(name,math,chinese) values(' Zhang San ',50,50),(' Li Si ',80,80),(' Wang Wu ',90,90);



Why aliases are available ?
- from Stage
- where Stage
- group Stage
- having Stage
- select Stage
- order by Stage
- limit Stage

summary
边栏推荐
- 自动化运维利器ansible基础
- Display picture of DataGridView cell in C WinForm
- TCP connection is more than communicating with TCP protocol
- Development and practice of lightweight planning service tools
- [introduction to MySQL] third, common data types in MySQL
- EasyCVR电子地图中设备播放器loading样式的居中对齐优化
- Precipitated database operation class - version C (SQL Server)
- BearPi-HM_ Nano development board "flower protector" case
- connection reset by peer
- Distributed (consistency protocol) leader election (dotnext.net.cluster implements raft election)
猜你喜欢
Sqoop I have everything you want
SQL statement optimization, order by desc speed optimization
Reppoints: advanced order of deformable convolution
Models used in data warehouse modeling and layered introduction
78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO
05 personal R & D products and promotion - data synchronization tool
07 personal R & D products and promotion - human resources information management system
Chrome prompts the solution of "your company management" (the startup page is bound to the company's official website and cannot be modified)
C# NanoFramework 点灯和按键 之 ESP32
传统家装有落差,VR全景家装让你体验新房落成效果
随机推荐
connection reset by peer
Growth of operation and maintenance Xiaobai - week 7
基本磁盘与动态磁盘 RAID磁盘冗余阵列区分
Xin'an Second Edition: Chapter 24 industrial control safety demand analysis and safety protection engineering learning notes
C# NanoFramework 点灯和按键 之 ESP32
Wechat applet obtains mobile number
MySQL报错解决
Spark calculation operator and some small details in liunx
Application service configurator (regular, database backup, file backup, remote backup)
MySQL error reporting solution
connection reset by peer
The art of Engineering (3): do not rely on each other between functions of code robustness
Flink analysis (I): basic concept analysis
Unity小技巧 - 绘制瞄准准心
【ASM】字节码操作 ClassWriter 类介绍与使用
Quick start of Hongmeng system
node の SQLite
MySQL 8 sub database and table backup database shell script
Models used in data warehouse modeling and layered introduction
Automatic operation and maintenance sharp weapon ansible Playbook