最近在使用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. 其他信息: ORA-01400: 无法将 NULL 插入

    这个错误其实就是oracle数据库的某列约束为 not null,但在插入值的时候插入了控制,无论是null和"",它都识别为空 有两种方法: 1.修改数据库字段约束为允许为空 2 ...

  2. PHP Xdebug安装及配置

    1.首先在官方网站下载dll文件; Xdebug官方网站 2.将php_xdebug.dll文件放入php/ext文件夹下; 3.编辑php.ini,在文件最后加入如下代码: ; Xdebug zen ...

  3. enote笔记法(2)——why的使用

    章节:why的使用 用法: why 概念|词汇(比概念更一般的形式的keyword)|短语|句子 用法1: why 概念|why keyword([比概念更一般的形式的keyword]) “why 概 ...

  4. Go环境搭建

    Linux系统golang环境搭建 1.下载安装包go1.8.linux-amd64.tar golang安装包下载地址:https://golang.org/dl/    ( 有可能被FQ) 2.解 ...

  5. (一)IDEA工具开第一个springboot应用之helloworld

    (一)IDEA工具开第一个springboot应用之helloworld 一.前置知识 1.maven相关知识 2.spring注解 3.RESTful API 二.idea开发第一个springbo ...

  6. 关于Could not resolve dependencies for project

    异常:Could not resolve dependencies for project 思路:网上提出的方案思路都是把相互依赖的项目导入到本地仓库中. 目前一劳永逸的方法是:将<packag ...

  7. 微信小程序与Java后台通信

    一.写在前面 最近接触了小程序的开发,后端选择Java,因为小程序的代码运行在腾讯的服务器上,而我们自己编写的Java代码运行在我们自己部署的服务器上,所以一开始不是很明白小程序如何与后台进行通信的, ...

  8. 关于苹果APP的上架整理

    由于苹果的机制,在非越狱机器上安装应用必须通过官方的App Store,开发者开发好应用后上传App Store,也需要通过审核等环节.AppCan作为一个跨主流平台的一个开发平台,也对ipa包上传A ...

  9. PHP时间戳和日期互转换

    在php中我们要把时间戳转换日期可以直接使用date函数来实现,如果要把日期转换成时间戳可以使用strtotime()函数实现,下面我来给大家举例说明. 1.php中时间转换函数 strtotime ...

  10. scrapy初试水 day02(正则提取)

    1.处理方式 法一 通过HtmlXPathSelectorimport scrapyfrom scrapy.selector import HtmlXPathSelectorclass DmozSpi ...