How to combine count() queries to tables in different environments?
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