当前位置:网站首页>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
边栏推荐
- yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本
- Models used in data warehouse modeling and layered introduction
- Automatic operation and maintenance sharp weapon ansible Foundation
- 07 personal R & D products and promotion - human resources information management system
- MySQL basic addition, deletion, modification and query of SQL statements
- C WinForm series button easy to use
- Vscode replaces commas, or specific characters with newlines
- 基本磁盘与动态磁盘 RAID磁盘冗余阵列区分
- The problem of "syntax error" when uipath executes insert statement is solved
- Alertmanager sends the alarm email and specifies it as the Alibaba mailbox of the company
猜你喜欢

Huawei certified cloud computing hica

基本磁盘与动态磁盘 RAID磁盘冗余阵列区分

78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO

Uipath browser performs actions in the new tab

About selenium starting Chrome browser flash back

Pytorch extract middle layer features?

Unity小技巧 - 绘制瞄准准心

After entering Alibaba for the interview and returning with a salary of 35K, I summarized an interview question of Alibaba test engineer

Virtual machine startup prompt probing EDD (edd=off to disable) error

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
随机推荐
BearPi-HM_ Nano development environment
【MySQL入门】第一话 · 初入“数据库”大陆
The solution to the left-right sliding conflict caused by nesting Baidu MapView in the fragment of viewpager
DataGridView scroll bar positioning in C WinForm
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
【MySQL入门】第四话 · 和kiko一起探索MySQL中的运算符
MySQL stored procedure
MySQL basic addition, deletion, modification and query of SQL statements
How to submit data through post
The art of Engineering (3): do not rely on each other between functions of code robustness
全网最全tcpdump和Wireshark抓包实践
Establishment of graphical monitoring grafana
OpenCV中如何使用滚动条动态调整参数
Unity小技巧 - 绘制瞄准准心
Spark calculation operator and some small details in liunx
Growth of operation and maintenance Xiaobai - week 7
当前系统缺少NTFS格式转换器(convert.exe)
Interpretation of Flink source code (I): Interpretation of streamgraph source code
[getting started with MySQL] fourth, explore operators in MySQL with Kiko
The art of Engineering