Last active
August 14, 2021 07:47
-
-
Save ndunks/1fad66790509b42075f6591d6e0f001c to your computer and use it in GitHub Desktop.
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
-- show all database | |
SELECT GROUP_CONCAT(SCHEMA_NAME) FROM information_schema.SCHEMATA | |
-- Show all table on current DB | |
SELECT GROUP_CONCAT(TABLE_NAME) FROM information_schema.TABLES where TABLE_SCHEMA = database() | |
-- Show all COLUMNS | |
SELECT GROUP_CONCAT(COLUMN_NAME) FROM information_schema.COLUMNS where TABLE_SCHEMA = database() and TABLE_NAME = '' | |
-- Use cast to string if fail | |
SELECT GROUP_CONCAT(CAST(COLUMN_NAME as CHAR)) FROM information_schema.COLUMNS where TABLE_SCHEMA = database() and TABLE_NAME = '' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment