tb_A
 col1   col2    col3   col4   state
 A001    aa      50     10    
得到为
tbB
col1   col2    col3   col4     state
 A001    aa      50     10       退
 A001    aa     -50     -10      退意思就是当state不为“退” 就插入一条负数的记录

解决方案 »

  1.   

    insert b select * from a where state<>'退'这样?
      

  2.   

    insert into ta_A(col1,col2,col3,col4,state)
    select col1,col2,-col3,-col4 from tb_A where state<>'退'
    update ta_A set state='退'
    where state<>'退'
      

  3.   

    insert tb_A
    select col1,col2,-col3,-col4,'退'
    from tb_A
    where state<>'退'
      

  4.   

    insert b select col1,col2,-col3,-col4 from a where state<>'退'
      

  5.   

    insert tb_B select col1,col2,-col3,-col4,'退' from tb_A where state <>'退'