Home > Back-end >  is it possible to speed up writing numbers in SQL?
is it possible to speed up writing numbers in SQL?

Time:05-31

I was wondering, in cases when you have to write big numbers such as 50.000.000.000, is it possible to write something like.. BILLION(50) or any shortcut?

CodePudding user response:

Yes, you can use 5e10 (meaning 5 x 1010). See https://dev.mysql.com/doc/refman/8.0/en/number-literals.html

But numbers expressed in scientific notation like that are interpreted as floating point constants, with a more limited precision, and calculations using them will continue to use floating point. For example:

select 5e16-1, 50000000000000000-1;

returns

5e16 49999999999999999
  • Related