mysql查询两表差集,mysql查询两表按某字段对比的差集数据,mysql查询两数据表的不同数据
a 表数据
0 1 2 3 4 5 6 7 8 9 10 11 12 |
+----+----+----+-----+ | id | aa | bb | cc | +----+----+----+-----+ | 1 | 22 | 30 | 44 | | 2 | 27 | 22 | 33 | | 3 | 0 | 40 | 0 | | 4 | 0 | 10 | 0 | | 5 | 11 | 0 | 44 | | 6 | 0 | 0 | 55 | | 7 | 0 | 0 | 99 | | 8 | 0 | 0 | 10 | | 9 | 0 | 0 | 101 | +----+----+----+-----+ |
b 表数据
0 1 2 3 4 5 6 7 8 9 |
+----+-------+----+ | id | dd | ee | +----+-------+----+ | 1 | 3万 | 33 | | 2 | 30万 | 44 | | 3 | 20万 | 11 | | 4 | 240万 | 22 | | 5 | haha | 55 | | 6 | 20万 | 66 | +----+-------+----+ |
对比a表的cc字段和b表的ee字段 Continue reading