gpt4 book ai didi

sql - 十进制到整数在SQL

转载 作者:行者123 更新时间:2023-12-04 22:03:41 25 4
gpt4 key购买 nike

删除十进制值

select cast(val as integer),val from table


我尝试了一下也不起作用,请告诉我解决方法。

select ROUND(2.9,0) from dual

24 23.8331134259259
31 30.8322222222222
31 30.8321990740741
31 31.1120023148148
31 31.1119791666667
28 28.0590046296296
31 31.1177314814815
4 4.05344907407407
4 4.03957175925926
14 13.7137731481481
5 4.79490740740741
5 4.79490740740741
5 4.79489583333333
5 4.79488425925926


预期产量:

23  23.8331134259259
30 30.8322222222222
30 30.8321990740741
30 31.1120023148148
30 31.1119791666667
28 28.0590046296296
31 31.1177314814815
4 4.05344907407407
4 4.03957175925926
13 13.7137731481481
4 4.79490740740741
4 4.79490740740741
4 4.79489583333333
4 4.79488425925926

最佳答案

嗨,尝试截断功能

TRUNC( number, [ decimal_places ] )

关于sql - 十进制到整数在SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19629093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com