执行如下语句报错:
```
select * from table_name
where a - b > 100;
```
其中a,b字段类型都为`int(10) unsigned `
### 解决方案:
使用cast(a as signed)语法将字段转换为signed. 最终语句如下:
```
select * from table_name
CAST(a as signed) - CAST(b as signed) > 100
```
(from my blog:https://blog.nice100.net/mysql/140.html)
mysql报错BIGINT UNSIGNED value is out of range
最新推荐文章于 2024-03-25 14:17:47 发布