Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '>'.

解决方案 »

  1.   

    update storegoo set price=case  when top1>0 then 1000  when top1<0 then 0 end where storelocid=9 and goodsid=31
      

  2.   

    update storegoo set price = case (select top 1 case when quantity>0 then 1 when quantity<0 then -1 else 0 end from storegoo) when 1 then 1000 when -1 then 0 end where storelocid=9 and goodsid=31或:update storegoo 
          set price = ( select top 1 
                          case 
                            when quantity>0 then 1000 
                            when quantity<0 then 0
                            else 0
                          end
                          from storegoo
                       )
          where storelocid=9 and goodsid=31