MYSQL版本比较新,有好几个错误问题
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c
-- 查看SQL_MODE
SELECT @@sql_mode;
-- 修改SQL_MODE
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
[MYSQL]Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '
select now();
show variables like "%time_zone%";
set global time_zone = '+8:00';
flush privileges;
show variables like "%time_zone%"
删除数据总数遇到的问题
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'
delete from xxxxx where id in (select t.id from xxxxx limit 0,500);
修改为
delete from xxxxx where id in (select t.id from (select id from xxxxx limit 0,500) as t);
查询可以这样写
select * from (select id from xxxxx limit 12) as foo;
网友评论