table diff for mysql via http://d.hatena.ne.jp/CAMUS/20060111/1136984749
- same table layout
- want to check key exists only on one side
SELECT KEY FROM (
SELECT KEY FROM TBL_A
UNION ALL
SELECT KEY FROM TBL_B
)
GROUP BY KEY
HAVING COUNT(*) = 1
- want to check all columns differs one another = table diff
SELECT KEY FROM (
SELECT * FROM TBL_A
UNION
SELECT * FROM TBL_B
)
GROUP BY KEY
HAVING COUNT(*) = 2