I’m run this query:
SELECT id,like - dislike as result
FROM mytable
Where the column like and dislike are unsigned integer. If the column dislike is greater than like mysql return number like 18446744073709551596, so seem that mysql treat this like unsigned and can’t return negative number but continue the computation from a sort of MAX_UNSIGNED_INT. How can I have the correct result
Try casting the two values (or maybe only on of them)
or only the result
In the first way you can get type overflow! The Second way is better, but I’m not sure it works with mysql.