注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
此贴想整理一下我知道的有关SQL window functions的基本信息和学习网站,欢迎大家补充!求米!
SQL window function 基本结构:
The syntax of the window functions is as follows:
window_function_name ( expression ) OVER (
partition_clause-baidu 1point3acres
order_clause
frame_clause. check 1point3acres for more.
)
SQL window function 种类:
The window functions are divided into three types value window functions, aggregation window functions, and ranking window functions.. From 1point 3acres bbs
第一种 - Value window functions
FIRST_VALUE(). .и
LAG()
LAST_VALUE()
LEAD()
第二种 - Ranking window functions
CUME_DIST(). 1point3acres
DENSE_RANK()
NTILE()
PERCENT_RANK()
RANK()
ROW_NUMBER()
第三种:Aggregate window functions
AVG()
COUNT(). 1point 3 acres
MAX()
MIN()
SUM()
SQL window function 网站:. 1point3acres
1.mode - 里面有挺多例子,推荐!可以练习,还有比较常用的几种ROW_NUMBER(), RANK(), DENSE_RANK() 讲解,比较实用。
https://mode.com/sql-tutorial/sql-window-functions/. 1point3acres
2. sqltutorial - 讲得很系统清晰,推荐!有图例,讲解细致,但是不能练习。
https://www.sqltutorial.org/sql-window-functions/
3. mysql reference manual - 讲解得特别细,但是有点太理论和繁琐了,不太适合初学者。. check 1point3acres for more.
https://dev.mysql.com/doc/refman ... unctions-usage.html
. ----欢迎补充。觉得有用,请不吝赐米!
求米,谢谢!
|