MySQL query gone wild?

前端 未结 1 428
醉梦人生
醉梦人生 2021-01-03 11:30

Can anyone tell me why the following is happening, and how to fix it?

I have a MySQL query with an ORDER BY clause that looks like this..

ORDER BY (d         


        
相关标签:
1条回答
  • 2021-01-03 12:10

    It's a known issue regarding subtraction from unsigned integers.

    Subtraction between integer values, where one is of type UNSIGNED, produces an unsigned result by default. If the result would otherwise have been negative, it becomes the maximum integer value. If the NO_UNSIGNED_SUBTRACTION SQL mode is enabled, the result is negative.

    Reference: Numeric Types

    0 讨论(0)
提交回复
热议问题