Giter Club home page Giter Club logo

Comments (2)

TeddiWolf avatar TeddiWolf commented on July 29, 2024

1.该异常产生原因为:
当数据库版本为5.7以上的版本时,默认是开启了 only_full_group_by 模式的,但开启这个模式后,会对SQL语句产生以下限制:
对于group by聚合操作,如果在select中的列没有在group by中出现,那么这个SQL就被认为是不合法的,因为列不在group by从句中,所以设置了sql_mode=only_full_group_by的数据库,在使用group by时就会报错
2.解决办法:
A.修改my.cnf(windows下是my.ini)配置文件,删掉only_full_group_by这一项,重启数据库
B.使用SQL命令(临时修改,数据库重启后该设置失效):
如:SET @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION';(单引号内不能包含only_full_group_by这一项)

from sia-task.

15036900300 avatar 15036900300 commented on July 29, 2024

我也是遇到了这个问题,也是无奈了

from sia-task.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.