0

Hi all,

I have two db,
one db "latestdb" which have latest six months records
second db "backupdb" which have oldest records of "latestdb" and this records deleted from "latestdb"

I have a query which should return records from both db. Query will return new records from "latestdb" and old records from "backupdb".
Is it possible to do ,if yes then how?
Please help me.
Thank you.

Edited by pritaeas: Removed markdown.

2
Contributors
4
Replies
22
Views
2 Years
Discussion Span
Last Post by rchawdhari
0

You can just reference the databases in your query.

SELECT * FROM database1.table1
UNION
SELECT * FROM database2.table1
0

Thank you,
My project have lots of query ,i have to change all queries which is not possible.
Is there any tool with execute query on both db?

0

i have to change all queries which is not possible.

You'll have to change something. Change the query, write a view or stored procedure. You can't get this information just automagically.

If you can change the database connection, a view might be the easiest option.

0

Thank you,

May be it will solve my problem, I will try by view and let you know.

Edited by pritaeas: Removed markdown.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.