当前位置:网站首页>Group by的用法
Group by的用法
2022-07-02 12:30:00 【芋辕-】
sql语句中的执行顺序:
from-> where -> join -> group by -> having ->select ->order by ->limit
group by之后,
select语句能够写的字段只有三种
1)group by的字段
2)聚合函数 sum count...
3) 常量值
例如:错误的写法,brand,model属性无法进行查询
select
mid_id,
brand,
model,
count(*) login
from dwd_start_log
group by mid_id;
纠正:
select
mid_id,
brand,
model,
count(*) login
from dwd_start_log
group by mid_id,brand,model;
边栏推荐
猜你喜欢
基于 Nebula Graph 构建百亿关系知识图谱实践
全是精华的模电专题复习资料:基本放大电路知识点
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
Introduction to Dynamic Planning II (5.647.62)
如何實現十億級離線 CSV 導入 Nebula Graph
Why does the system convert the temp environment variable to a short file name?
《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究
《大学“电路分析基础”课程实验合集.实验四》丨线性电路特性的研究
How to import a billion level offline CSV into Nepal graph
Aike AI frontier promotion (7.2)
随机推荐
The outline dimension function application of small motherboard
【idea】推荐一个idea翻译插件:Translation「建议收藏」
[leetcode] 167 - sum of two numbers II - enter an ordered array
[leetcode] 486 predict winners
/Bin/ld: cannot find -lcrypto
Application of visualization technology in Nebula graph
PostgresSQL 流复制 主备切换 主库无读写宕机场景
Wise target detection 23 - pytoch builds SSD target detection platform
动态规划入门一,队列的bfs(70.121.279.200)
(5) Flink's table API and SQL update mode and Kafka connector case
Wavedec2 in MATLAB, talk about the wavedec2 function [easy to understand]
Nebula Graph & 数仓血缘关系数据的存储与读写
ssh/scp 使不提示 All activities are monitored and reported.
《大学“电路分析基础”课程实验合集.实验四》丨线性电路特性的研究
[leetcode] 1140 stone game II
使用 percona 工具给 MySQL 表加字段中断后该如何操作
College entrance examination score line climbing
Ssh/scp does not prompt all activities are monitored and reported
XPT2046 四线电阻式触摸屏
Make p12 certificate [easy to understand]