Last active
March 15, 2018 18:22
-
-
Save jonpemby/687cf739124212195bbfc95308dceb67 to your computer and use it in GitHub Desktop.
MySQL find all required columns from table
This file contains hidden or 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
select * from information_schema.COLUMNS | |
where TABLE_SCHEMA = 'schema' | |
and TABLE_NAME = 'table' -- optionally specify the table | |
and IS_NULLABLE = 'NO' -- optionally set to 'YES' to find nullable columns | |
and COLUMN_DEFAULT is null; -- optionally specify columns without a default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment