mysql 是否具有相当于 Oracle 的“分析函数"?

2021-11-20 00:00:00 sql database mysql oracle

我正在 MySQL 中寻找像 PARTITION BY 这样的分析函数(请参阅 文档 了解更多信息)

I'm looking for analytical function like PARTITION BY in MySQL (see the docs for more info)

分析函数计算基于一组的聚合值行.它们与聚合函数的不同之处在于它们返回每组多行.

Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in that they return multiple rows for each group.

它存在吗?

推荐答案

不,与 MSSQL、Oracle、PostgreSQL 等其他 DBMS 相比,这是 MySQL 的主要不足之一.我强烈怀疑将来会在 MySQL 中看到窗口函数,尤其是在 Oracle 收购 MySQL 之后......

2018 年 4 月更新

MySQL 8.0 现在支持窗口函数.

MySQL 8.0 now supports window functions.

相关文章