I’m getting the following error
#1690 – BIGINT UNSIGNED value is out of range in ‘(
legends.spawns.quantity–tmp_field)’
Here is my query:
SELECT drops.common, drops.uncommon, drops.rare, drops.legendary, spawns . *
, ( quantity - COUNT( game_moblist.spawn_id ) ) AS quantity_to_spawn
, mobs . *
FROM spawns
LEFT JOIN mobs
USING ( mob_id )
LEFT JOIN game_moblist
USING ( spawn_id )
LEFT JOIN drops ON (
SELECT MAX( level )
FROM drops
WHERE drops.type = mobs.drop_list
AND drops.level <= spawns.level )
GROUP BY spawn_id
HAVING quantity_to_spawn >=0
AND next_spawn <=0
I’ve been staring at it for a while the query is long I’m sorry.
spawns table – count game_moblist.spawn_id is 0 for all possible rows but 1 (I deleted a row to test the query)
The data otherwise is quite long and irrelevant to my question I think
Any idea how to get around this error?
Please read “Out-of-Range and Overflow Handling“.
It says:
To enable the operation to succeed in this case, convert the value to unsigned;
A change to part of your query, as following, would solve the issue.
Otherwise you may require to change the
sql_modeon unsigned operations.and then run your query to get desired output.
See also a similar posting answered on a forum here.