852那么我得到的值为850150
那么我得到的值为15017555
那么我得到的值为17550怎么做

解决方案 »

  1.   


    -- =============================================
    -- Author:      T.O.P
    -- Create date: 2009/11/24
    -- Version:     SQL SERVER 2005
    -- =============================================
    declare @TB table([A] int)
    insert @TB
    select 852 union all
    select 150 union all
    select 1755select FLOOR(A/10.0)*10 AS A
    from @TB
    --测试结果:
    /*
    A
    ---------------------------------------
    850
    150
    1750(3 row(s) affected)*/
      

  2.   

    ---测试数据---
    if object_id('[tb]') is not null drop table [tb]
    go
    create table [tb]([col] int)
    insert [tb]
    select 852 union all
    select 150 union all
    select 17555
     
    ---查询---
    select col/10*10 as col from tb---结果---
    col         
    ----------- 
    850
    150
    17550(所影响的行数为 3 行)
      

  3.   

    select col/10*10 from tb