insert int a(a,b,c) select '01', x,'N' from b where x='999'

解决方案 »

  1.   

    insert into a(a,b,c) select '01', x,'N' from b where x='999'
      

  2.   

    不好意思!写错了:
    insert int a(a,b,c) select '01',(select x from b where x='999'),'N';
    应该是:insert int a(a,b,c) select '01',(select x from b where b.x=c.y),'N' from c;
      

  3.   

    insert into a(a,b,c) select '01', x,'N' from b where x='999'
      

  4.   

    insert int a(a,b,c) 
    (select '01',b.x ,'N' from b,c where b.x=c.y);
      

  5.   

    是我说的不明白.事实上是这样的:
    insert int a(a,b,c) select '01',(select x from b where b.x=c.y),'N' from c;
    '01','N'实际上表c的字段值,即:
    insert int a(a,b,c) select c.x,(select x from b where b.x=c.y),c.z from c;
      

  6.   

    试试这个吧,
    insert into a(a,b,c) select '01',b.x,'N' from b,c where b.x=c.y;
      

  7.   

    这个肯定行.
    我这个语句其实是做了一个代码转换,表b是一个代码表,用它的汉字来替换表c中查出的字母代码,如果改成楼上的形式,只是如果表c的代码在表b中不存在,那么,我的语句只是这个值为空,而换成楼上的语句,就会少了一行.
      

  8.   

    insert int a(a,b,c) select c.x,b.x,c.z from c,b
    where b.x=c.y;
      

  9.   

    insert int a(a,b,c) select c.x,b.x,c.z from c,b
    where b.x=c.y(+);
    用一个左连接不就可以了么???