房天下 > 房天下问答 > 业主生活 > 其他
  • SQL Server2000自带计算机列让计算结果保留一位小数,该怎么做呢?

    提问者:oyangbing

    发布于2010-09-15

共1个回答
  • 安聊海阔 丨Lv 2
    create table test( col1 int, col2 float, col3 as cast(col1+col2 as decimal(18,1)))--插入数据insert test values(1,2.111)insert test values(2,3.1)insert test values(3,3)--看结果select * from test /*col1 col2 col3----------- ---------------------- ---------------------------------------1 2.111 3.12 3.1 5.13 3 6.0*/
    +1 2010-09-15 举报
热门人气推荐
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。