insert into tongji select tmptab.* from tmptab left outer join tongji on tmptab.cardnum=tongji.cardnum and tmptab.xfdate=tmptab.xfdate and tmptab.xftime=tongji.xftime where tongji.cardnum is not null
大致是这样,试试吧.
最后的条件错了,修改如下:
insert into tongji select tmptab.* from tmptab left outer join tongji on tmptab.cardnum=tongji.cardnum and tmptab.xfdate=tmptab.xfdate and tmptab.xftime=tongji.xftime where tongji.cardnum is null