Count distinct on elastic search

后端 未结 4 1310
面向向阳花
面向向阳花 2020-12-11 07:07

How to achieve count distinct function on elastic search type using sql4es driver?

Select distinct inv_number , count(1) from invoices;

But

4条回答
  •  無奈伤痛
    2020-12-11 07:20

    Since, the OP is using sql4es jdbc driver, he is asking for a sql query for his use-case :

    SELECT COUNT(DISTINCT inv_number) from invoices;
    

    it returns the number of distinct values of the specified column

提交回复
热议问题