# Use distinct(\*) with count function

**URL:** <https://community.influxdata.com/t/use-distinct-with-count-function/6123>\
**Category:** Systems\
**Tags:** influxdb\
**Created:** [August 5, 2018, 7:52am UTC](https://community.influxdata.com/t/use-distinct-with-count-function/6123 "2018-08-05T07:52:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad\_ghoreshi](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mohammad\_ghoreshi](https://community.influxdata.com/u/mohammad_ghoreshi)\
**Post date:** [August 5, 2018, 7:52am UTC](https://community.influxdata.com/t/use-distinct-with-count-function/6123/1 "2018-08-05T07:52:48Z")

</div>

Due to InfluxDB [doc](https://docs.influxdata.com/influxdb/v1.6/query_language/functions/#distinct), we can use “distinct” function in nested syntax as follow:  
SELECT COUNT(DISTINCT( [\* | \<field\_key\> | /\<regular\_expression\>/] )) […]  
but when I perform this query:  
SELECT COUNT(DISTINCT(\*)) From \<my\_measurement\>  
I got error:  
ERR: expected field argument in distinct()

---

<div class="post-metadata">

**Author:** ![mschae16](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mschae16/32/1005_2.png) [@mschae16](https://community.influxdata.com/u/mschae16)\
**Post date:** [August 6, 2018, 7:59pm UTC](https://community.influxdata.com/t/use-distinct-with-count-function/6123/2 "2018-08-06T19:59:03Z")

</div>

Did you put the measurement name in double-quotes? Could you show us the query you ran?

---

<div class="post-metadata">

**Author:** ![rcsg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rcsg/32/4488_2.png) [@rcsg](https://community.influxdata.com/u/rcsg)\
**Post date:** [February 27, 2020, 2:40pm UTC](https://community.influxdata.com/t/use-distinct-with-count-function/6123/3 "2020-02-27T14:40:46Z")

</div>

Hello  
I got the same error ERR: expected field argument in count()

Here’s my query :

SELECT COUNT(DISCTINCT(\*)) FROM “container\_tasks\_state” where “state” = ‘running’

any help?  
Thanks in advance  
Kind regards
