Skip to content

Instantly share code, notes, and snippets.

@henrytran9x
Created September 30, 2017 16:18
Show Gist options
  • Save henrytran9x/2af188e47fc754e2ce89ab81a245cc70 to your computer and use it in GitHub Desktop.
Save henrytran9x/2af188e47fc754e2ce89ab81a245cc70 to your computer and use it in GitHub Desktop.
Query get all information columns of table
SELECT column_name, data_type, character_maximum_length, numeric_precision, numeric_scale, is_nullable, column_type, column_default, column_key, extra FROM information_schema.columns WHERE table_name = 'table_name' AND table_schema = 'name_database' ORDER BY ordinal_position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment