- 博客(3)
- 收藏
- 关注
原创 Mysql:BIGINT value is out of range in ‘******‘
selectst.uid*10+1 from student as st;错误:BIGINT value is out of range in '(`student`.`st`.`uid` * 10)'原因在于student.uid* 10长度过长或者有负数,超过字段类型范围字段类型为 `uid` bigint(20) NOT NULL DEFAULT '0' COMMENT '学生id',数据为‘8359387873396123111’,长度为19,再乘以10后长度范围,...
2021-09-03 11:47:20
1124
原创 mysql-group by取各分组最新一条数据
数据需要按照uid分组,取出每组uid最新的那条数据,想要的结果三种方式1.先用orderby排序,然后用groupby分组select * from (select * from t1order by create_time desc limit 10000) t2group by uid注意:因为mysql中groupby不一定取的是第一条数据,这里一定要用limit2.maxselect * from t1 where (uid,create_...
2021-09-02 17:04:37
5398
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅