Group by query doesn't return what I expect

I have a measurement that contains a variable state (-1, 1) and uid. I need to be able to group by uid, and get the sum of states. But for some reason it only groups for the uid="", which doesn’t exist.

> select distinct(uid) from user_actions;
name: user_actions
time distinct
---- --------
0    0
0    1
0    2
0    3
0    5
0    4
0    6
0    7
0    8
0    12
0    10
0    9
> select distinct(uid) from user_actions;^C
> select sum(state) from user_actions group by uid;
name: user_actions
tags: uid=
time sum
---- ---
0    61

Whether uid is a tag ?

1 Like

Hello @blasrodri,
What version of Influx are you running? Can you share some of your raw data with me so I can try replicating on my end?
What does select state from user_actions group by uid show? Do you have more than one value in each result?

Thanks! It wasn’t tag