Compare same tables from 2 different databases but exclude user_id and date in comparison in SQL

  Kiến thức lập trình

I am trying to compare same tables from 2 different database to achieve the difference rows based on table.For that I have return below query:

[select table_name
from all_tables
where owner = ‘MDWMP’]
|
[select @table_name tbl,
count(*)
from((select *
from mdwmp. @table_name:raw
minus
select *
from mdwmd. @table_name:raw)
union
(select *
from mdwmd. @table_name:raw
minus
select *
from mdwmp. @table_name:raw))] catch(-1403);
where mdwmp is my 1st database and mdwmd is my 2nd database.

This query is giving me an error: ORA-00932: inconsistent datatypes: expected – got CLOB.
Tables may contain modified_user_id, date&time column. I want to exclude such columns from the comparison.

Tables may contain modified_user_id, date&time column. I want to exclude such columns from the comparison. and get the unique values.

LEAVE A COMMENT