当前位置:网站首页>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
边栏推荐
- 78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO
- [introduction to MySQL] third, common data types in MySQL
- The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
- 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
- 学 SQL 必须了解的 10 个高级概念
- Concept and basic knowledge of network layering
- SQL statement optimization, order by desc speed optimization
- Flexible report v1.0 (simple version)
- 基本磁盘与动态磁盘 RAID磁盘冗余阵列区分
- Single responsibility principle
猜你喜欢
Vscode matches and replaces the brackets
BearPi-HM_ Nano development environment
Solr appears write Lock, solrexception: could not get leader props in the log
Pyspark operator processing spatial data full parsing (5): how to use spatial operation interface in pyspark
Integrated development management platform
PyTorch 提取中间层特征?
TCP connection is more than communicating with TCP protocol
C # nanoframework lighting and key esp32
分布式(一致性协议)之领导人选举( DotNext.Net.Cluster 实现Raft 选举 )
Flink parsing (VII): time window
随机推荐
[elastic] elastic lacks xpack and cannot create template unknown setting index lifecycle. name index. lifecycle. rollover_ alias
EasyCVR授权到期页面无法登录,该如何解决?
Solution qui ne peut pas être retournée après la mise à jour du navigateur Web flutter
Solr appears write Lock, solrexception: could not get leader props in the log
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
Flink parsing (IV): recovery mechanism
一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升
Spark accumulator and broadcast variables and beginners of sparksql
【Elastic】Elastic缺少xpack无法创建模板 unknown setting index.lifecycle.name index.lifecycle.rollover_alias
Solrcloud related commands
视频融合云平台EasyCVR增加多级分组,可灵活管理接入设备
Summary of study notes for 2022 soft exam information security engineer preparation
The most complete tcpdump and Wireshark packet capturing practice in the whole network
Selenium test of automatic answer runs directly in the browser, just like real users.
当前系统缺少NTFS格式转换器(convert.exe)
03 products and promotion developed by individuals - plan service configurator v3.0
Openharmony developer documentation open source project
05 personal R & D products and promotion - data synchronization tool
Yarn: unable to load file d:\programfiles\nodejs\yarn PS1, because running scripts is prohibited on this system
The art of Engineering