Reputation: 11
If I have two tables A and B. I want to know if this table are same or not ? i.e check does columns match ? and does data match ?
Upvotes: 1
Views: 42
Reputation: 1210
Query USER_TAB_COLUMNS for each table
SELECT table_name, column_name,
FROM USER_TAB_COLUMNS
WHERE table_name = 'MYTABLE'
And you can compare it for matching columns .
(hawk's answer will do it in one step.)
Upvotes: 0
Reputation: 5170
SELECT *
FROM
(
(SELECT * FROM Table1
MINUS
SELECT * FROM Table2)
UNION ALL
(SELECT * FROM Table2
MINUS
SELECT * FROM Table1)
)
Upvotes: 1