Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MySQL真是意外的错误。BIGINT超出范围_Mysql - Fatal编程技术网

MySQL真是意外的错误。BIGINT超出范围

MySQL真是意外的错误。BIGINT超出范围,mysql,Mysql,我有一个很复杂的问题,在中有很好的解释。我没有更改查询中的任何内容,也没有更改与此系统相关的任何内容,但是我突然发现了这个错误 中的BIGINT无符号值超出范围 “(\u db广告总印象-(cast)((curdate())- 将(\u dbadsstartas date))转换为未签名)* \u dbads每天的印象) 我真的很困惑,我想有些事情不对,但我能做什么呢?我真的需要帮助。这似乎是你的问题 (_db.ads.impressions_total - (cast(((curdate())

我有一个很复杂的问题,在中有很好的解释。我没有更改查询中的任何内容,也没有更改与此系统相关的任何内容,但是我突然发现了这个错误

中的BIGINT无符号值超出范围 “(
\u db
广告
总印象
-(cast)((curdate())- 将(
\u db
ads
start
as date))转换为未签名)*
\u db
ads
每天的印象


我真的很困惑,我想有些事情不对,但我能做什么呢?我真的需要帮助。

这似乎是你的问题

(_db.ads.impressions_total - (cast(((curdate()) - cast(_db.ads.start as date)) as unsigned) * _db.ads.impressions_perday
获取两个日期之间差异的正确方法是使用
datediff()
。所以我想知道这是否能解决你的问题:

_db.ads.impressions_total - datediff(curdate(), cast(_db.ads.start as date))*_db.ads.impressions_per_day

你需要做的是去了解或做一些研究,而不是懒洋洋地发布这个问题here@Bojangles但是我没有在任何地方使用bigint?是的,你是
CAST(…作为unsigned)
所以我按照第一条评论中问题的建议将其更改为signed,但我仍然得到错误消息,这不仅解决了我的问题,而且我相信大大简化了查询!