update tableName set theMemo..............     where id in (某ID 范围)
我想把某个表的备注字段都在 已有内容的基础上统一加上指定内容,例如符合条件的记录都在自己已有备注的内容基础上统一加上“这是一个测试”,请问这样的更新语句,SQL 应该怎么写?

解决方案 »

  1.   

    update tableName set theMemo=theMemo+'这是一个测试'  where id in (某ID 范围) 
      

  2.   

    update tableName set theMemo=theMemo+N'这是一个测试'    where id in (某ID 范围) 
      

  3.   


    update tableName set 备注字段=备注字段+‘这是一个测试’    where id in (某ID 范围) 
      

  4.   

    update tableName set theMemo=theMemo+'这是一个测试' where id in 
      

  5.   

    theMemo=thememo +'zhe shi yi ge ce shi'
      

  6.   

     
    update tableName set theMemo=theMemo+'这是一个测试' where id in (某ID 范围) 
      

  7.   

    update tableName set theMemo=theMemo+N'这是一个测试'  where id in (某ID 范围) 
      

  8.   

    update tableName set theMemo=theMemo+'这是个测试'    where id in (某ID 范围) 
      

  9.   

    update tableName set theMemo=theMemo+N'这是一个测试'  where id in (某ID 范围) 
      

  10.   

    theMemo=theMemo+' Test' 我发现如果该theMemo字段如果原先是空的即 Null,那么用这种方式 是加不上任何内容上去的
    该怎么处理?
      

  11.   


    update tableName set theMemo=isnull(theMemo,'')+'这是一个测试'  where id in (某ID 范围)