SQL> create table test (num number(16,2));表已创建。SQL> insert into test values (15.02);已创建 1 行。SQL> commit;提交完成。SQL> select * from test; NUM ---------- 15.02SQL> col num format 99.9999 SQL> select * from test; NUM -------- 15.0200SQL>
create table t_a (ixd number(10,4)); insert into t_a values(15.7700); select * from t_a;IXD ---------- 15.7700
我打错了 其实是比如表里的一个字段类型为: number(16,4) 要显示成12.0200
Create Table t (idd Number(10,4));Insert Into t Values(10.02);Commit;select * From t; 这样不可以么?
数字型无法做到,只是一个显示问题
----------
15.02SQL> col num format 99.9999
SQL> select * from test; NUM
--------
15.0200SQL>
insert into t_a values(15.7700);
select * from t_a;IXD
----------
15.7700
要显示成12.0200
Create Table t (idd Number(10,4));Insert Into t Values(10.02);Commit;select * From t;
这样不可以么?
如果是,
你看看tool--preference--sql window--number layouts
里面是怎么设置的
insert into t2 select 1,10.02 from dual;
insert into t2 select 1,19.0200 from dual;
select id,to_char(num,'FM99.0000') from t2;1 10.0200
1 19.0200