update 表 set 字段 = 值 where 字段 in (select top 100 字段  from 表)

解决方案 »

  1.   

    update fyinfo set batch_serial =011 where batch_serial='001' in (select top 10 from fyinfo)服务器: 消息 156,级别 15,状态 1,行 1
    在关键字 'in' 附近有语法错误。
    服务器: 消息 156,级别 15,状态 1,行 1
    在关键字 'from' 附近有语法错误。
      

  2.   

    --查询
    select top 100 * from 表--更新
    update 表 set 字段=值 where 关键字段=(select top 100 关键字段 from 表)
      

  3.   

    还的麻烦你,单独可查询出来,可改不了某字段的值:原表中字段batch_serial 值是001 ,要改为011
      

  4.   

    update 表名  set batch_serial='001' where 关键字段=(select top 100 关键字段 from 表)
      

  5.   

    update 表名  set batch_serial='011' where 关键字段=(select top 100 关键字段 from 表)
      

  6.   

    update 表名  set batch_serial='011' where batch_serial='001'
      

  7.   

    怎么跟SELECT TOP 10 * FROM FYINFO WHERE Batch_Serial = '001'结合起来用呢??
      

  8.   

    update 表名  set batch_serial='011' where 关键字段 in (select top 100 关键字段 from 表)
      

  9.   

    关键字段可以是batch_serial吗? in可不可以改为exists呢?如何用?我用上边的了,报错exists的子查询中只能用一个子句