Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to combine count() queries to tables in different environments?

we5inelgrJan 29 2013 — edited Jan 31 2013
Hi all,

I've got two tables that have the same schema, but slightly different data. One is a test db, and the other is a model office db (i.e. neither is a production db).

I run these two queries, individually, from within the test db:

select count(cdeSource), cdeSource
from schema1.SomeTable
group by cdeSource
order by cdeSource



select count(cdeSource), cdeSource
from schema1.SomeTable@TheModelOfficeDB
group by cdeSource
order by cdeSource


The column cdeSource can contain a 1 to 1 relationship with another field in the tables, but it can also contain a 1 to many with the other field.

Right now, I need to export each result into a file and then do a compare between the two to find the differences, between the two tables, out of the big results.

Question: How can I combine those two queires into 1, and show only the differences from the "count(cdeSource)" results column?

Thanks.

Edited by: we5inelgr on Jan 29, 2013 5:29 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2013
Added on Jan 29 2013
10 comments
517 views