Skip to content

Instantly share code, notes, and snippets.

@Cabeda
Last active June 18, 2019 09:07
Show Gist options
  • Save Cabeda/a5d510357688a579288eae0a7eec9dc1 to your computer and use it in GitHub Desktop.
Save Cabeda/a5d510357688a579288eae0a7eec9dc1 to your computer and use it in GitHub Desktop.
Check if two tables have the same columns
--Check different columns
select znew.column_name as newcol,
zold.column_name as oldcol
from (
select column_name
from information_schema.columns
where table_schema = 'zendesk'
and table_name = '_groups') zold
full join
(select column_name
from information_schema.columns
where table_schema = 'zendesk_new'
and table_name = 'group') znew on znew.column_name = zold.column_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment