我想计算唯一对的数量。我正在尝试查询:
select count(distinct a, b) from t
但它给出了错误:
ERROR: function count(integer, integer) does not exist
我该如何解决这个问题?
最佳答案
元组的语法是 (a, b)。因此你的查询应该是
select count (distinct (a, b)) ab_count from t
关于postgresql - 我如何计算 Postgres 9.6 中唯一对的数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50531424/