本帖最后由 viphk 于 2011-03-17 19:42:15 编辑

解决方案 »

  1.   

    update betting set zjhm='123',
    zhangtai=(case when charindex('1',hm)>0 or charindex('2',hm)>0 or charindex('3',hm)>0 then '已中奖' else '未中奖' end),
    jjrmb=(case when charindex('1',hm)>0 or charindex('2',hm)>0 or charindex('3',hm)>0 then rmb*6.6/2 end) 
    where lx='A'and qi='17073'
      

  2.   

    update betting set zjhm='123',
    zhangtai=(case when charindex('1',hm)>0 or charindex('2',hm)>0 or charindex('3',hm)>0 then '已中奖' else '未中奖' end),
    jjrmb=(case when charindex('1',hm)>0 or charindex('2',hm)>0 or charindex('3',hm)>0 then rtrim(rmb*6.6/2) end) 
    where lx='A'and qi='17073'
      

  3.   

    如果你的字段是字符串型,则如下:update betting set zjhm='123',
    zhangtai=(case when charindex('1',hm)>0 or charindex('2',hm)>0 or charindex('3',hm)>0 then '已中奖' else '未中奖' end),
    jjrmb=(case when charindex('1',hm)>0 or charindex('2',hm)>0 or charindex('3',hm)>0 then cast(rmb*6.6/2 as varchar) end) 
    where lx='A'and qi='17073'