Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
C#
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.
Posted
Updated 26-Sep-13 0:26am
v3

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
 
Share this answer
 
(select * from T1 minus select * from T2)
union all
(select * from T2 minus select * from T1);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900