我们有一个 ERP 系统,它允许使用聚合(例如SUM(foo))但不允许使用 DISTINCT(例如SUM(DISTINCT foo).
SUM(foo)
SUM(DISTINCT foo)
是否可以创建一个聚合函数 ( SUM_DISTINCT),它返回与 相同的结果SUM(DISTINCT foo),所以SUM_DISTINCT(foo) = SUM(DISTINCT foo)?
SUM_DISTINCT
SUM_DISTINCT(foo) = SUM(DISTINCT foo)
postgresql aggregate distinct
aggregate ×1
distinct ×1
postgresql ×1