Programmabilities Blog
2007-08-30
SQL compare two tables
Difference in data stored in both tables (compare the difference between two tables)? You can use SQL to see rows which don't have a match in one table or the other:
Select col_a,col_b from table1
where not exists
(select * from table2
where table1.col_a = table2.col_a and
table1.col_b = table2.col_b)
Repeat for table2.
further notes: --http://windowsitpro.com/Articles/ArticleID/14368/14368.html?Ad=1 --http://webmasterworld.com/databases_sql_mysql/3241540.htm
Labels: sql







