Skip to content

Instantly share code, notes, and snippets.

@igorpronin
Last active May 30, 2017 08:57
Show Gist options
  • Save igorpronin/9ddae59ed7bc6f523756261da2cea918 to your computer and use it in GitHub Desktop.
Save igorpronin/9ddae59ed7bc6f523756261da2cea918 to your computer and use it in GitHub Desktop.
Вывести имена колонок и тип данных для определенной таблицы
-- 1
select column_name, data_type
from information_schema.columns
where table_name = 'users';
-- 2
SELECT
column_name, data_type, character_maximum_length
FROM
information_schema.COLUMNS
WHERE
TABLE_NAME = 'sales_funnel';
-- 3
SELECT
*
FROM
information_schema.COLUMNS
WHERE
TABLE_NAME = 'sales_funnel';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment