64

What is the equivalent of a Java long in the context of MySql variables?

dimwittedanimal
  • 644
  • 1
  • 14
  • 28
syker
  • 10,486
  • 16
  • 53
  • 66

2 Answers2

83

SIGNED BIGINT is a 8-bytes long integer just like Java's long.

Crozin
  • 42,946
  • 13
  • 87
  • 135
19

Java long max value is positive: 9,223,372,036,854,775,807

This means for positive only unsigned numbers UNSIGNED BIGINT(19) should be enough or you can just use UNSIGNED BIGINT which is equal to UNSIGNED BIGINT(20)

If you are going to use negative numbers as well BIGINT(19) will be enough.

Fırat KÜÇÜK
  • 5,218
  • 1
  • 46
  • 53