USE
Syntax
DESCRIBE
Syntax (Get Information About Columns)
DESCRIBE
Syntax (Get Information About Columns){DESCRIBE | DESC} tbl_name [col_name | wild]
DESCRIBE
is a shortcut for SHOW COLUMNS FROM
.
See section 4.5.7.1 Retrieving information about Database, Tables, Columns, and Indexes.
DESCRIBE
provides information about a table's columns. col_name
may be a column name or a string containing the SQL `%' and `_'
wildcard characters to obtain output only for the columns with names matching
the string. There is no need to enclose the string in quotes.
If the column types are different from what you expect them to be based on a
CREATE TABLE
statement, note that MySQL sometimes
changes column types. See section 6.5.3.1 Silent Column Specification Changes.
This statement is provided for Oracle compatibility.
The SHOW
statement provides similar information.
See section 4.5.7 SHOW
Syntax.
Posted by Thuon Chen on Monday March 24 2003, @1:21pm | [Delete] [Edit] |
DESCRIBE TABLE may show you a field with a value of MUL
even though you defined the field as UNIQUE KEY. If you have not specified NOT NULL, the field can contain multiple values of NULL, thus the MUL. To change value of UNIQUE KEY to UNI specify NOT NULL in your CREATE TABLE statement.