我想把select * from c where cpbh='12521'
这句话insert 到A表的一个字段中怎么做
insert into a(cpbh) select 'select * from c where cpbh='12521''提示错误那个'12521'要怎么表示呢:?

解决方案 »

  1.   

    insert into a(cpbh) select 'select * from c where cpbh=''12521''' 
      

  2.   

    insert into a(cpbh) select 'select * from c where cpbh=''12521''' 
      

  3.   

    insert into a(cpbh) select 'select * from c where cpbh=''12521'''
      

  4.   


    create table test(name varchar(20))
    insert test
    select '''12521'''select * from testname                 
    -------------------- 
    '12521'(所影响的行数为 1 行)
      

  5.   

    insert into a(cpbh) select 'select * from c where cpbh=''12521''' 
    --字符串中出现的字符串用两个单引号