hive> select CAST(18446744073709551614BD AS DECIMAL(38,0))+CAST(18446744073709551614BD AS DECIMAL(38,0));
OK
36893488147419103228
Time taken: 0.334 seconds, Fetched: 1 row(s)
hive> select CAST(18446744073709551614BD AS DECIMAL(38,0))*2;
OK
36893488147419103228
Time taken: 0.129 seconds, Fetched: 1 row(s)
1条答案
按热度按时间4xrmg8kj1#
使用
decimal(38, 0)
对于存储比bigint大的数字,它可以存储38位数字。bigint可以存储19位数字。同时阅读有关十进制类型的手册。文字后缀
BD
是必需的。例子: