select * from sys_hist where id = '200'  insert into .......  Update...........

解决方案 »

  1.   

    create table #1(x int)
    go
     insert into #1 values(10)
    exec('select * from #1 where x=10
          insert into #1 values(20)
          update #1 set x=30 where x=10')select * from #1x           
    ----------- 
    30
    20(2 row(s) affected)
      

  2.   

    我觉得,这都不是一句SQL语句,
    都是三句了
    分别是select
          insert
          update
    这三句了
      

  3.   

    to:
     OpenVMS(半知半解) 是在一条单独的语句中完成
      

  4.   

    exec('select * from #1 where x=30 insert into #1 values(20)')x           
    ----------- 
    30(1 row(s) affected)
    (1 row(s) affected)算一句吗
      

  5.   

    可以有insert , update子句的么??!
    呵呵,学习!!
      

  6.   

    OpenVMS(半知半解) 哈哈,高手!!!
    我另外开贴给分你,请进来。
      

  7.   

    UPDATE当然一样
    把语句写在一起就OK了
      

  8.   

    create table #1(x int)
    exec('select * from #1 where x=30 insert into #1 values(20)')
    你运行这句好像没有结果显示吧
      

  9.   

    加在前面嘛:insert #(a,b,c)                   --
    select a,b,c from (               --
    select * from sys_hist where id = '200'
    )as x                            --