有张表a
  aid     a
 001     0.5其中a字段的数据类型是float
用update a set a=25/7780 where aid='001'
更新后却变成
  aid     a
 001     0.0
这是为什么?

解决方案 »

  1.   

    update a set a=25.0/7780 where aid='001' 
      

  2.   

    按照你的update a set a=25.0/7780 where aid='001' 数据却变成:
      aid    a 
    001    3.2133676090000001E-3好象还是不对啊?
      

  3.   

    update a set a=convert(numeric(10,4),25)/7780 where aid='001'有效数字自己控制
      

  4.   

    update a set a=convert(numeric(10,4), convert(numeric(10,4),25)/7780) where aid='001'
      

  5.   

    如果是update a set a=(25.0000)/(7780.0000) where aid='001' 
    怎么来更新?
      

  6.   

    update a set a=25/7780 where aid='001' 
    25/7780 两个都是整数,保留小数位的话需要进行显示转换,分子分母只要有一个保留小数即可如:
    update a set a=25*1.00000/7780 where aid='001' 
    或:
    update a set a=25.00000/7780 where aid='001' 
    或:
    update a set a=25/7780.00000 where aid='001' 
      

  7.   

     对float型进行显示转换下,就好了!
      

  8.   

    为什么把7780换成7630就又会不对了。aid    a 
    001    3.2765390000000002E-3