Hello, I Have This Database error ..
Code:
Database error in vBulletin 4.1.8:
Invalid SQL:
SELECT `userid`, '' AS `username`, `bets`, `wr`, `rd`, (`bets`-`wr`-`rr`-`rd`) AS `rw`, `rr`,
(`wr`*0)+
(`rr`*3)+
(`rd`*2)+
((`bets`-`wr`-`rr`-`rd`)*1) AS `sum_pts`,
((`wr`/`bets`)*0)+
((`rr`/`bets`)*3)+
((`rd`/`bets`)*2)+
(((`bets`-`wr`-`rr`-`rd`)/`bets`)*1) AS `avg_pts`
FROM
(
SELECT b.`userid`, COUNT(*) AS `bets`,
SUM(`score_key`!=`bet_score_key`) AS `wr`,
SUM(`bet_home`=`points_home` AND `bet_away`=`points_away`) AS `rr`,
SUM(CAST(`bet_home`-`bet_away` AS SIGNED)=(`points_home`-`points_away`)
AND NOT (`bet_home`=`points_home` AND `bet_away`=`points_away`)) AS `rd`
FROM `soccer_user_bet` AS b
INNER JOIN `soccer_match` AS m ON (m.`id`=b.`match_id`)
WHERE `dateline` BETWEEN 1341100800 AND 1343779200 AND `score_key`>0
GROUP BY b.`userid`
) AS `foo`
ORDER BY sum_pts desc , avg_pts desc
LIMIT 0, 30;
MySQL Error : BIGINT UNSIGNED value is out of range in '(`database name`.`b`.`bet_home` - `database name`.`b`.`bet_away`)'
Error Number : 1690
Request Date : Saturday, July 21st 2012 @ 12:13:49 PM
Error Date : Saturday, July 21st 2012 @ 12:13:49 PM
Script : http://*******/vbsoccer.php?do=overallranking
Referrer : http://******/vbsoccer.php
IP Address : ******
Username : *****
Classname : vB_Database
MySQL Version : 5.6.4-m7