ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle insert插入number(1)列的数据小测试

oracle insert插入number(1)列的数据小测试

原创 Linux操作系统 作者:wisdomone1 时间:2012-12-04 14:12:49 0 删除 编辑
SQL> desc t_t_1;
Name Type      Nullable Default Comments
---- --------- -------- ------- --------
A    NUMBER(1) Y                        
 
SQL> insert into t_t_1 values(1);
 
1 row inserted
 
SQL> insert into t_t_1 values(2);
 
1 row inserted
 
SQL> insert into t_t_1 values(8.1111111111);
 
1 row inserted
 
SQL> insert into t_t_1 values(8.113333333333333333);
 
1 row inserted
 
SQL> insert into t_t_1 values(9.113333333333333333);
 
1 row inserted
 
SQL> commit;
 
Commit complete
 
SQL> select * from t_t_1;
 
 A
--
 1
 2
 8
 8
 9
 
小结:1,oracle表的列如果定义为number(1),会自动截断小数部分的内容,仅保留整数部分的数据

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-750509/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12690138