Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why does the bigint type in SQL store negative numbers?
Why does the bigint type in SQL store negative numbers?

It is not a matter of data type. Bigint stores data in the range from -2^63

(-9223372036854775808) to 2^63-1(9223372036854775807)

number. The storage size is

8

bytes. But when you get the value, because the data type is bigint, the program will automatically convert your data into int type. The range of your data 106594712998 exceeds the maximum range of int, so the program will automatically intercept it, and finally -779469402 will appear. So when getting the value, you should change it to: result.getLong() to get the value.