MYSQL新版问题汇总
简书链接:MYSQL新版问题汇总
文章字数:66,阅读全文大约需要1分钟
MYSQL版本比较新,有好几个错误问题
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c
1 | -- 查看SQL_MODE |
[MYSQL]Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value ‘
1 | select now(); |
删除数据总数遇到的问题
delete from xxxxx where id in (select t.id from xxxxx limit 0,500);
[Err] 1235 - This version of MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’
1 | delete from xxxxx where id in (select t.id from xxxxx limit 0,500); |
修改为
1 | delete from xxxxx where id in (select t.id from (select id from xxxxx limit 0,500) as t); |
查询可以这样写
1 | select * from (select id from xxxxx limit 12) as foo; |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 情迁博客!
评论