Created
May 27, 2021 13:38
-
-
Save bruno-uy/0b065d9e3d41812a7b17fcc60960b4c9 to your computer and use it in GitHub Desktop.
Check if columns exists in Redshift table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- You can count the rows to be equal to columns that you're checking | |
SELECT * | |
FROM information_schema.columns | |
WHERE table_schema = '<table_schema>' | |
AND table_name = '<table_name>' | |
AND column_name IN ('<column1>', '<column2>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment