Skip to content

Instantly share code, notes, and snippets.

@prule
Created March 16, 2013 09:08
Show Gist options
  • Save prule/5175603 to your computer and use it in GitHub Desktop.
Save prule/5175603 to your computer and use it in GitHub Desktop.
Show the columns that are missing from 'owner1' when compared to 'owner2' for tables that match the prefix
SELECT table_name, column_name, data_type FROM all_tab_cols
WHERE lower(owner)=lower(:owner1)
AND table_name LIKE :prefix
AND column_name NOT LIKE 'SYS%'
AND table_name||'-'||column_name NOT IN
(SELECT table_name||'-'||column_name FROM all_tab_cols
WHERE lower(owner)=lower(:owner2)
)
ORDER BY table_name, column_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment