DEV Community

Query Filter
Query Filter

Posted on

compare

SELECT 'ONLY_IN_US_1' AS location, table_name
FROM   (
    SELECT table_name
    FROM   dba_tables
    WHERE  owner = 'GLOBAL_COMET_US_1'
    MINUS
    SELECT table_name
    FROM   dba_tables
    WHERE  owner = 'GLOBAL_COMET_US_2'
)
UNION ALL
SELECT 'ONLY_IN_US_2' AS location, table_name
FROM   (
    SELECT table_name
    FROM   dba_tables
    WHERE  owner = 'GLOBAL_COMET_US_2'
    MINUS
    SELECT table_name
    FROM   dba_tables
    WHERE  owner = 'GLOBAL_COMET_US_1'
)
ORDER BY location, table_name;

Enter fullscreen mode Exit fullscreen mode

Top comments (0)