alter table fcdata_cj00 add (fc_qjs_2 NUMBER(25,6) default 0 not null); 后默認值為0 而不是0.000000;
如果把not null 去掉 alter table fcdata_cj00 add (fc_qjs_2 NUMBER(25,6) default 0 ); 資料庫的值就為0.00000了
求解 跪謝!!!
uj5u.com熱心網友回復:
自己先頂一個uj5u.com熱心網友回復:
SQL>
SQL> col c1 format 0000;
SQL> create table test(c1 int);
Table created
SQL> insert into test(c1) values(1);
1 row inserted
SQL> alter table test add c2 number(25,6) default 0 not null;
Table altered
SQL> alter table test add c3 number(25,6) default 0;
Table altered
SQL> insert into test(c1) values(2);
1 row inserted
SQL> select * from test;
C1 C2 C3
---- --------------------------- ---------------------------
1 0.000000 0.000000
2 0.000000 0.000000
SQL> drop table test purge;
Table dropped
SQL>
uj5u.com熱心網友回復:
SQL> create table test111(c1 int);SQL> insert into test111(c1) values(1);
SQL> alter table test111 add c2 number(25,6) default 0 not null;
SQL> alter table test111 add c3 number(25,6) default 0;
SQL> insert into test111(c1) values(2);
SQL> select * from test111;
C1 C2 C3
---- --------------------------- ---------------------------
1 0 0.000000
2 0 0.000000
大神為什么我的C2是0,而不是0.00000
uj5u.com熱心網友回復:
是不是在sqlplus 里跑的? 那個只是顯示的問題,資料沒錯。uj5u.com熱心網友回復:
我是在plsql 里面跑的uj5u.com熱心網友回復:
兩種方式都是0.000000你重新建表試試
uj5u.com熱心網友回復:
這個東東是不是與OS的環境設定也有關系啊。我顯示結果,都是0.在sqlplus下。
SQL> select * from test;
C1 C2 C3
---------- ---------- ----------
1 0 0
2 0 0
SQL> desc test
名稱 是否為空? 型別
----------------------------------------- -------- ----------------------------
C1 NUMBER(38)
C2 NOT NULL NUMBER(25,6)
C3 NUMBER(25,6)
uj5u.com熱心網友回復:
我在sqlplus 里面顯示的也都是0, 在plsql里面顯示C2是0, C3是0.000000 不清楚為什么會這樣uj5u.com熱心網友回復:
把number換成decimal試試看。uj5u.com熱心網友回復:
還有糾結這個呢, 這是兩個客戶端,屬于顯示格式的問題。
sqlplus 里有 col col_name format 語法,可以設定。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/68234.html
標籤:開發
上一篇:Oracle中的having問題
