表名不能用user(属于保留字),改成t_user之类的名称

解决方案 »

  1.   

    update user set user_photo ='null' where user_name ='qq' 
      

  2.   

    先拿你的 SQL 到 SQL Server Query Analyzer
    试试看就知道对错…
      

  3.   

    你用的是不是MySQL,我也遇到过,1楼的回答得对,不一定SQL Server中对的,MySQL中就对。
      

  4.   

    我在DB2中使用的sql语句为:
          update t_cm_user set user_photo = null where user_name = 'qq'
     我的目的是将一个user_photo(blob的字段)置空,在DB2中测试,DB2会一直执行用不停下来,也不报错。
      我的问题是怎样将以一个blob字段置空?
      

  5.   

    update user set user_photo ='' where user_name ='qq'
      

  6.   

    To heyday(水中天) :
       试过了,这样就报错:DB21034E  The command was processed as an SQL statement because it was not a valid Command Line Processor command.  During SQL processing it returned:SQL0408N  A value is not compatible with the data type of its assignment target.  Target name is "USER_PHOTO".  SQLSTATE=42821
      

  7.   

    不用=null,用is null之类的试试~
      

  8.   

    最好不要用USER做表名,其余的同意楼上几位的观点