且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将数据与不同的数据库进行比较

更新时间:2023-01-21 13:19:55

也许:

select * from database1.table1其中to_char(column1,'DD-MM-YYYY')不在(从database2.table2中选择to_char(column1,'DD-MM-YYYY'),其中order_date> sysdate-1)



和检查db2是否可以从db1接收,即GRANT SELECT TO DB2.Table2 ON DB1


(选择*从T1减去选择*从T2)

union所有

(从T2中选择*减去从T1中选择*);


hi all good afternoon ,

i have tried to fetch data from table1 in database1 those records not in another table in another database.i tried below sample query.

select * from database1.table1 where column1 not in(select column1 from database2.table2 where order_date>sysdate-1)


the above sample query is not working.
how can i get data from table by comparing another table data from another database.

maybe :
select * from database1.table1 where to_char(column1, 'DD-MM-YYYY') not in (select to_char(column1, 'DD-MM-YYYY') from database2.table2 where order_date>sysdate-1)

and check that db2 can be accesed from db1, that is GRANT SELECT TO DB2.Table2 ON DB1


(select * from T1 minus select * from T2)
union all
(select * from T2 minus select * from T1);