-
Difference between two tables
Hi folks,
What is the easiest way to find out that the two tables contain the same data ?
And also how can i find out the difference b/n the two tables.
The scenario, i happened to copy a table data into other some time back. I wanted to find out whether there is any diff or is the table data same
-
Hi,
You could write a select with a Minus clause on the 2 tables and find out the difference in data.
Regards
Slash
(MCP)
-
One of the simplest way is get the count from both the tables this will tell u the no. of records on both the tables.
regards
anandkl
anandkl
-
Originally posted by anandkl
One of the simplest way is get the count from both the tables this will tell u the no. of records on both the tables.
regards
anandkl
What if any of the records are only updated ?
or one record is deleted and another is addeded ?
I think Slash's idea sounds good.......
Last edited by bang_dba; 10-06-2003 at 11:30 AM.
-
as slash said. if the structure is the same just do a
select * from table1
minus
select * from table2
if not that you'll have to specify the columns you want to check.
chris
Last edited by mrchrispy; 10-07-2003 at 05:51 AM.
-
Describe what you mean by "difference." Tables can contain the same data (or subset, thereof), but be different in structure. If you don't know if the data set is still the same, then would you know if the structure has been changed (added/dropped a column)?
-
That slash stuff will/may not give you everything...It could be anyother way round and should be both ways round....
Tarry Singh
I'm a JOLE(JavaOracleLinuxEnthusiast)
--- Everything was meant to be---
-
Hi,
Minus returns the distinct rows returned from the first query but not from the second.
So got to be careful when using Minus.....
One more thing which i can think of to find the difference between two tables is Spooling both the tables into a separate text file and use OS command(diff) to findout the difference.
I think this would be the best solution to find out the difference between the table data.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|