RT,字段类型为float 10长度

解决方案 »

  1.   


    --参考一下:SQL> create table ttt(iid number(15,2));Table createdSQL> insert into ttt values(221347.99);1 row insertedSQL> commit;Commit completeSQL> select * from ttt;              IID
    -----------------
            221347.99SQL> 
      

  2.   

    FYI: http://jimmyhe1981.itpub.net/post/19858/130417
    --可以考虑用NUMBER型:
    SQL> SET SERVEROUTPUT ON
    SQL> CREATE TABLE TEST_TTT (FIELD1 NUMBER(10,2));Table createdSQL> INSERT INTO TEST_TTT VALUES(221347.99);1 row insertedSQL> COMMIT;Commit completeSQL> SELECT * FROM TEST_TTT;      FIELD1
    ------------
       221347.99SQL> INSERT INTO TEST_TTT VALUES(22134768.99);1 row insertedSQL> COMMIT;Commit completeSQL> SELECT * FROM TEST_TTT;      FIELD1
    ------------
       221347.99
     22134768.99
      

  3.   

    LZ说的和证实的结果是一致的。
    float主要用来浮点计算,还是使用number来定义吧。
      

  4.   

    intel公司与amd公司的cpu计算符点数据的精度有时候是不一样的;
    也有可能是cpu的问题我建议你用数据类型numeric代码float
      

  5.   

    我一般建表时,如果是字符型就用varchar2,浮点型就用number(m,n)一般金额什么的
      

  6.   

    Oracle Online Help 说:FLOAT(b) specifies a floating-point number with binary precision b. The precision b can range from 1 to 126. To convert from binary to decimal precision, multiply b by 0.30103。看最后一句"To convert from binary to decimal precision, multiply b by 0.30103。"float(10) --> INT(10*0.30103) = 3
    221347.99 --> 2.213 * 10 ^ 5 = 221300
    0.99 --> 0.990 * 10 ^0 = 0.99