insert  table1(a) select a,'你的值' from table2

解决方案 »

  1.   

    insert  table1 select a,@你的变量 from table2
      

  2.   

    insert  table1(a,b) select a,'你的值' from table2
      

  3.   

    table1中b字段的值并不在table2中,要通过变量来赋值,所以无法select
      

  4.   

    insert  table1(a,b) select a,'你的值' from table2
    就行
      

  5.   

    declare @c char(5)set @c='11'exec( 'insert table(a,b) select a,'''+@c+''' from table2 where a=''xxx''')
      

  6.   

    to 楼主你看不懂吗?还是我理解错了?declare @变量 int
    set @变量=34insert 一个表 (一个列,第二个列) select 一个列,@变量 from 另一个表