Mysql筛选出两张表中不同的数据的SQL

1.筛选不同的数据

select * from b_sendmsgb where not EXISTS(select * from sendmsgb_bak where b_sendmsgb.cardNum=sendmsgb_bak.cardNum);

2.筛选出不通数据后,按卡号排序

select * from sendmsgb_bak where not EXISTS(select * from b_sendmsgb where sendmsgb_bak.cardNum=b_sendmsgb.cardNum) ORDER BY cardNum;

posted @ 2020-05-11 17:11  Curedfisher  阅读(9988)  评论(0编辑  收藏  举报