Select Count(1) dealQty, F_Name, F_Key,0 as edrPOSQty 
                 into test3 From test Where F_DealDate is not null  
                 group by F_Name, F_Key
edrPOSQty 是新增字段, 需要设置为DECIMAL
怎么做,谢谢

解决方案 »

  1.   

    Select Count(1) dealQty, F_Name, F_Key,cast(0 as decimal(8,2)) as edrPOSQty 
    into test3 From test Where F_DealDate is not null 
    group by F_Name, F_Key
      

  2.   

    cast(edrPOSQty as decimal(19,2))
      

  3.   

    Select Count(1) dealQty, F_Name, F_Key,0 as cast(edrPOSQty as decimal(19,2))
    into test3 From test Where F_DealDate is not null 
    group by F_Name, F_Key
      

  4.   

    cast(0 as decimal(18,2)) as edrPOSQty 或者convert(dec(18,2),0) as edrPOSQty 
      

  5.   


    Select Count(1) dealQty, F_Name, F_Key,cast(0 as dec(28,2)) as edrPOSQty 
    into test3 From test Where F_DealDate is not null 
    group by F_Name, F_Key