17,377
社区成员
发帖
与我相关
我的任务
分享
scott@SZTYORA> create table t(col1 number(6,2), col2 number(6,0));
create public synonym T for scott.T
表已创建。
已用时间: 00: 00: 00.04
scott@SZTYORA> insert into t values(0,0);
已创建 1 行。
已用时间: 00: 00: 00.00
scott@SZTYORA> insert into t values(0.38,1);
已创建 1 行。
已用时间: 00: 00: 00.00
scott@SZTYORA> insert into t values(1.48,5);
已创建 1 行。
已用时间: 00: 00: 00.01
scott@SZTYORA> select * from t;
COL1 COL2
---------- ----------
0 0
.38 1
1.48 5
已用时间: 00: 00: 00.01
scott@SZTYORA> commit;
提交完成。
已用时间: 00: 00: 00.01
scott@SZTYORA> select col1, col2, vsize(col1) v1, vsize(col2) v2 from t;
COL1 COL2 V1 V2
---------- ---------- ---------- ----------
0 0 1 1
.38 1 2 2
1.48 5 3 2
已用时间: 00: 00: 00.01
-- 你表面上看到的是0,这只是一种数据显式的形式,并不一定代表其表中实际存储的数据就是整数0!
-- 请看示例:
create public synonym T for scott.T
表已创建。
已用时间: 00: 00: 00.06
scott@SZTYORA> insert into t(vnum) values(0);
已创建 1 行。
已用时间: 00: 00: 00.00
scott@SZTYORA> select * from t;
VNUM
----------
0
已用时间: 00: 00: 00.01
scott@SZTYORA> col vnum for 99.99
scott@SZTYORA> l
1* select * from t
scott@SZTYORA> /
VNUM
------
.00
已用时间: 00: 00: 00.01
scott@SZTYORA> col vnum for 90.99
scott@SZTYORA> l
1* select * from t
scott@SZTYORA> /
VNUM
------
0.00
已用时间: 00: 00: 00.00