gpt4 book ai didi

sql - SQL 中的 MAX(DISTINCT x) 是什么?

转载 作者:行者123 更新时间:2023-12-04 15:11:32 28 4
gpt4 key购买 nike

我只是偶然发现 jOOQ's maxDistinct SQL aggregation function .

什么MAX(DISTINCT x)做不同于只是 MAX(x) ?

最佳答案

maxDistinctminDistinct定义是为了与其他聚合函数保持一致,其中具有不同的选项实际上会有所不同(例如, countDistinctsumDistinct )。

由于在数据集的不同值之间计算的最大值(或最小值)在数学上与同一集合的简单最大值(或最小值)等效,因此这些函数本质上是多余的。

关于sql - SQL 中的 MAX(DISTINCT x) 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22244307/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com