I have a query that looks like this:
SELECT ROUND((wins/matches * (elo - 2000))) as rank FROM kittens ORDER BY elo ASC LIMIT 1
In phpmyadmin, it constantly returns #1690 - BIGINT UNSIGNED value is out of range
. The corresponding query with DESC instead of ASC works fine, so I assume it’s choking on the negative numbers.
I’ve looked all around and I can’t see anything anywhere about a way to make these “temporary columns” signed. It doesn’t seem like it can be this hard. If anyone knows how to get this right I’d really appreciate their insight.