InfluxDB:cannot use field in group by clause
2020-01-15 06:38
92 查看
最近在使用InfluxDB时,发现一个很奇怪的问题,一个本来正常的功能,做了一次改动后,就不能正常显示了.
一、查询语句
SELECT MEMORY FROM "ACM_PROCESS_MONITOR" GROUP BY USER_NAME
异常信息如下:
Server returned error: can not use field in GROUP BY clause: USER_NAME
Group By语句后面,只能是Tag列,不能是Field列
二、查看所有Tag列
说明USER_NAME是Tag列
三、查看所有Field列
说明USER_NAME是Field列
综上所述,USER_NAME既是FIELD列,又是TAG列!
四、问题产生原因
产生这个问题的原因,是因为UESER_NAME以前确实是FIELD列:
因为不能在GROUP BY 中查询,于是把它设置为了TAG列:
为了方便,删除了原来的表,数据都是新的,GROUP BY 没有问题。
今天一不小心,又启用了改之前的程序,导致又把USER_NAME作为了FIELD列,所以GROUP BY的时候出问题了。
老外的描述:https://github.com/influxdata/influxdb/issues/3783
解决方案:
1.把表删了重建,然后启用新程序
或:
2.重新为USER_NAME取一个作为TAG列的名字:TAG_USER_NAME,数据都写到这里,用它作为GROUP BY的Tag列
转载于:https://www.cnblogs.com/liugh/p/8128065.html
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- InfluxDB:cannot use field in group by clause
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause...
- Mysql [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause
- #1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i
- ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains
- sql --it is not contained in either an aggregate function or the GROUP BY clause.
- mysql 1130错误 和1055 - Expression #1 of ORDER BY clause is not in GROUP BY
- Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'party.uc.
- APP-SQLAP-10380: You cannot select this payment document because it is in use by another payment
- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c
- Error Code: 1055. Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated
- #1055 - Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column this i
- mysql查询报错: ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by
- Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'inform
- Mysql解决SELECT list is not in GROUP BY clause and contains nonaggregated column 问题
- mysql遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonag
- ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate
- MySQL异常:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggr
- SELECT list is not in GROUP BY clause and contains
- mysql遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题