admin159 发表于 2007-12-13 13:01

怎么样使卸出的decimal数值不带小数点?

create table table (f_test decimal(10,2))

比如表中存放的是1.01,2.02,3.03

unload to a.txt select f_test*100 from table

结果:

101.0
202.0
303.0

希望:
101
202
303

谢谢

ivhb 发表于 2007-12-13 13:41

unload to a.txt select cast (select f_test*100 as integer) from table

admin159 发表于 2007-12-13 13:53

编译都过不去

大哥,这是4gl里的吗?

ivhb 发表于 2007-12-13 19:03

unload 是 sql语句么?

wenlq 发表于 2007-12-14 08:29

unload to a.txt select trunc(f_test*100)||""   from table

admin159 发表于 2007-12-14 08:45

原帖由 wenlq 于 2007-12-14 08:29 发表 http://bbs.chinaunix.net/images/common/back.gif
unload to a.txt select trunc(f_test*100)||""   from table
这个在isql里可以,在程序里不行。

wenlq 发表于 2007-12-14 08:48

在什么程序里?

admin159 发表于 2007-12-14 14:19

原帖由 wenlq 于 2007-12-14 08:48 发表 http://bbs.chinaunix.net/images/common/back.gif
在什么程序里?
.4gl里呀
页: [1]
查看完整版本: 怎么样使卸出的decimal数值不带小数点?