SELECT id,title FROM ( SELECT id, title FROM t1 UNION ALL SELECT id,title FROM t2 ) tbl GROUP BY id, title HAVING count(*) = 1 ORDER BY id;
http://www.mysqltutorial.org/compare-two-tables-to-find-unmatched-records-mysql.aspx
Blog đang chỉnh sửa
SELECT id,title FROM ( SELECT id, title FROM t1 UNION ALL SELECT id,title FROM t2 ) tbl GROUP BY id, title HAVING count(*) = 1 ORDER BY id;
0 comments:
Post a Comment