COLUMNS table provides information about
columns in tables.
display includes values from several different
ORDINAL_POSITION is necessary because you
might want to say
SELECT does not have automatic ordering.
CHARACTER_OCTET_LENGTH should be the same
CHARACTER_MAXIMUM_LENGTH, except for
multi-byte character sets.
CHARACTER_SET_NAME can be derived from
Collation. For example, if you say
SHOW FULL COLUMNS FROM t, and you see in
Collation column a value of
latin1_swedish_ci, the character set is
what's before the first underscore:
The following statements are nearly equivalent:
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '
tbl_name' [AND table_schema = '
db_name'] [AND column_name LIKE '
wild'] SHOW COLUMNS FROM
db_name] [LIKE '