补充:
将A表的记录插入B表
A表B表都无主键,所以插入的记录无唯一标识

解决方案 »

  1.   

    insert into b select * from a;
    update b set 数量=0
    where rowid not in (select min(rowid) from b group by id);
      

  2.   

    insert into b
    select id,money,lag(0,1,qty) over(partition by id order by id )
      from a;
      

  3.   

    b表就不要了create view b (id,money,qty) as
    select id,money,lag(0,1,qty) over(partition by id order by id )
      from a;
      

  4.   

    onejune4450(中文字符)你说的方法我还没有尝试,你能否解释一下lag 和 over 这两个函数的含义。