计数不同和不同计数KDB之间的差异

时间:2017-08-22 20:59:57

标签: kdb

" count distinct table"有什么区别?和"不同的计数表"在KDB?我以为count distinct table给了我不同行的数量但是不同的count表给了我不同的值

2 个答案:

答案 0 :(得分:5)

这种不同的行为在kdb + 2.7中被更改为阻止标量操作;

来自README.txt;

const router: Router = appInjector().get(Router);

答案 1 :(得分:2)

“count distinct”将为您计算不同的值,而“distinct count”将为您计算总值,因为在应用distinct之前已经计算了值。

让我们考虑一个例子 例如:

t1: ([] a: 1 2 3 1 2 3 4)

select count distinct a from t1 / Output is 4 i.e count of distinct values
select distinct count a from t1 / Output is 7 i.e total count of values
相关问题