表名:product
列1:user
列2:timeupdate product set time=REPLACE(time,'2009','2011')
我想判断USER再更新TIME如何操作?

解决方案 »

  1.   

    if update(user)update product set time=REPLACE(time,'2009','2011')
      

  2.   

    服务器: 消息 140,级别 15,状态 1,行 1
    只能在 CREATE TRIGGER 语句内部使用 IF UPDATE。
      

  3.   

    if exists(select 1 from  product  where user='xxx')
    update product set time=REPLACE(time,'2009','2011')
      

  4.   


    更新了所有user时间...
    没有更新指定的user
      

  5.   

    update product set time=REPLACE(time,'2009','2011')
    where user=''