---
title: "Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggre"
author: "bugyun"
date: "2018-12-17T16:48:26Z"
tags: []
categories: ["编程语言"]
slug: "expression-1-of-order-by-clause-is-not-in-group-by-clause-and-contains-nonaggre"
draft: false
lastmod: "2018-12-17T16:48:26Z"
id: 2435329
url: "https://bugyun.iteye.com/blog/2435329"
---

转：https://www.cnblogs.com/zhi-leaf/p/5998820.html

 

错误信息：

Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information\_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql\_mode=only\_full\_group\_by

 

具体出错提示：

\[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information\_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql\_mode=only\_full\_group\_by

 

1、查看sql\_mode

```
select @@global.sql_mode
```

查询出来的值为：

ONLY\_FULL\_GROUP\_BY,STRICT\_TRANS\_TABLES,NO\_ZERO\_IN\_DATE,NO\_ZERO\_DATE,ERROR\_FOR\_DIVISION\_BY\_ZERO,NO\_AUTO\_CREATE\_USER,NO\_ENGINE\_SUBSTITUTION

2、去掉ONLY\_FULL\_GROUP\_BY，重新设置值。

```
set @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
```