update LH_lh set ma2=
(
  
  case when ma2='yi'
        then '1'
        when ma2='san' then '0002'
  else ma2 end
  
) where pici='91'
上面执行正常下面不正常,不管条件是怎么,总会执行 当等于'yi'后面的结果,请问为什么update LH_lh set ma2=
(
  
  case when ma2='yi'
        then (isnull((select MAX(ma2) from LH_lh where pici<>'91' and ma1=(select ma1 from lh_lh where pici='91') and did=(select did from LH_lh where pici='91') and zid=(select zid from LH_lh where pici='91') and xid=(select xid from LH_lh where pici='91')),0)+1)
        when ma2='san' then '0002'
  else ma2 end
  
) where pici='91'