最近在使用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列

InfluxDB:cannot use field in group by clause的更多相关文章

  1. SELECT list is not in GROUP BY clause and contains nonaggregated column

    报错如下: Expression # of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘sss.m ...

  2. MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

    1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'rpa ...

  3. [mysql] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'loser.tank_admin.login_ip' which is not functionally dependent on columns in GROUP BY clause; this is

    执行SQL: SELECT login_name,login_ip,sex FROM tank_admin GROUP BY login_name ; 时抛出异常. Expression #2 of ...

  4. [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 and contains nonaggregate ...

  5. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

    安装了mysql5.7.19后,执行语句中只要含有group by 就会报这个错 [Err] 1055 - Expression #1 of ORDER BY clause is not in GRO ...

  6. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.

    安装了mysql5.7,用group by 查询时抛出如下异常: Expression # of SELECT list is not in GROUP BY clause and contains ...

  7. 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contai

    之前一直使用的mysql5,突然换成8之后,有许多地方不一样,今天就碰到一个. 在使用sql语句创建表时,报错:  1055 - Expression #1 of ORDER BY clause is ...

  8. MYSQL---Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column '

    --数据库中插入数据或执行sql语句时一直报下面这个错误: Expression # of ORDER BY clause is not in GROUP BY clause and contains ...

  9. mysql问题解决SELECT list is not in GROUP BY clause and contains nonaggregated column

    今天在Ubuntu下的部署项目,发现一些好好的列表页面发生 :Expression # of SELECT list is not in GROUP BY clause and contains no ...

随机推荐

  1. Thrift全面介绍

    官网:http://thrift.apache.org   简介 Thrift是一个软件框架,用来进行可扩展且跨语言的服务的开发.它结合了功能强大的软件堆栈和代码生成引擎,以构建在 C++, Java ...

  2. 掌握numpy(三)

    统计功能 前面都是介绍numpy的一些特性,被称为数学运算神器怎么能少了统计功能呢 ndarray的方法 a = np.array([[-2.5, 3.1, 7], [10, 11, 12]]) &g ...

  3. pandas选择数据-【老鱼学pandas】

    选择列 根据列名来选择某列的数据 import pandas as pd import numpy as np dates = pd.date_range("2017-01-08" ...

  4. Azure 基础 : 使用 Automation 定时开机

    不知何时 Azure 为虚机提供了自动关机的功能.这是一个很棒的功能,可以帮助我们定时关闭虚机并释放掉资源以节省开支.如果某台虚机在夜间不需要提供服务,我们就可以把它配置为晚上的某个时间点自动关机: ...

  5. 安卓自定义控件(五)触控基础MotionEvent

    之前去面试,人家说,我这个事件拦截机制写得太少了,还有一个MotionEvent没写,这个确实也很重要,后来我考虑了一下,决定将这篇文章放到自己定义控件里. 先简单再提一下事件分发,事件分发和拦截主要 ...

  6. JAVAFX-3 开发应用

    理解布局 布局容器(Layoutcontainer)或面板(Pane)允许对JavaFX应用程序场景图中的UI控件进行灵活.动态的排布.JavaFX Layout API包括下列容器类: ● Bord ...

  7. Intellij IDEA热加载更新 IntelliJ IDEA热加载自动更新(Update classes and resources )

    定义及分类 1.1 定义 在web开发环境下,所谓热部署,即在不重新部署webapp的情况下,实时将工程代码改动更新到web容器中(例如tomcat).其原理可以类比ajax的作用,即局部刷新工程资源 ...

  8. Error when sending message to topic test with key: null, value: 2 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)

    windows下使用kafka遇到这个问题: Error when sending message to topic test with key: null, value: 2 bytes with ...

  9. Webapi调用

    C# webapi 路由名称不能跟area名称相同,否则出现404 action找不到的问题???

  10. 使用map做数组与链表去重

    #include<iostream> #include<map> using namespace std; class node{ public: node():value() ...