20.3. The INFORMATION_SCHEMA COLUMNS Table

MySQL 5.0

20.3. The INFORMATION_SCHEMA COLUMNS Table

The table provides information about columns in tables.

Name Name Remarks
 
   
   
 
  see notes
 
 
 
 
   
 
 
   
 
MySQL extension
MySQL extension
MySQL extension
MySQL extension

Notes:

  • In , the display includes values from several different columns.

  • is necessary because you might want to say . Unlike , does not have automatic ordering.

  • should be the same as , except for multi-byte character sets.

  • can be derived from . For example, if you say , and you see in the column a value of , 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 = ''
  [AND table_schema = '']
  [AND column_name LIKE '']

SHOW COLUMNS
  FROM 
  [FROM ]
  [LIKE '']