我只是好奇:我知道一些
SUM(string = 'anyString') over (partition by ANY_COLUMN)
或
SUM(string like 'anyWildcard%') over (partition by ANY_COLUMN)
is w或king in MySQL/MariaDB. What would be the equivalent in Oracle?
我只是好奇:我知道一些
SUM(string = 'anyString') over (partition by ANY_COLUMN)
或
SUM(string like 'anyWildcard%') over (partition by ANY_COLUMN)
is w或king in MySQL/MariaDB. What would be the equivalent in Oracle?
ANSI/ISO SQL标准方法是使用case
expressions来执行conditional aggregation:
SUM(case when string = 'anyString' then 1 else 0 end) over (partition by ANY_COLUMN)
Standards compliance note:
使用case
表达式是Core SQL功能,即预期工作在any dbms上.
FILTER
是ANSI/ISO SQL标准的可选特性.'Without Feature T612, “Advanced OLAP operations”, conforming SQL language shall not contain a < filter clause >.'