July 28, 2005 at 4:59 pm
Hi All,
Do you know any script to compare data difference between 2 tables? Thanks for you help.
Minh Vu
July 29, 2005 at 12:16 am
I suppose the two tables have the same definition. You could of course execute "select * from ? order by ?", save results to files and make a file comparison.
You could also write a script yourself. If rows are unique, you could execute something like
select * from a where not exists
(select * from b where
(a.col1 = b.col1 and a.col2 = b.col2))
to see what rows are in table a but not table b. If rows are not unique, you could create a new table a1 and execute
insert into a1 select col1, col2, count(*) from a group by col1, col2
and the same select for b (and b1) and then compare tables a1 and b1 using the method above.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply