Oracle 5.0 Reference Manual page 1196

Table of Contents

Advertisement

+---------------------+----------+----+---------+----------+---------+
| big5_chinese_ci
| dec8_swedish_ci
| cp850_general_ci
| hp8_english_ci
| koi8r_general_ci
| latin1_swedish_ci
...
13.7.5.5.
SHOW COLUMNS
SHOW [FULL] COLUMNS {FROM | IN}
[LIKE 'pattern' | WHERE expr]
SHOW COLUMNS
MySQL 5.0.1. The
clause can be given to select rows using more general conditions, as discussed in
"Extensions to
mysql>
SHOW COLUMNS FROM City;
+------------+----------+------+-----+---------+----------------+
| Field
+------------+----------+------+-----+---------+----------------+
| Id
| Name
| Country
| District
| Population | int(11)
+------------+----------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
If the data types differ from what you expect them to be based on a
that MySQL sometimes changes data types when you create or alter a table. The conditions under
which this occurs are described in
The
keyword causes the output to include the column collation and comments, as well as the
FULL
privileges you have for each column.
You can use
other words, these two statements are equivalent:
mysql>
SHOW COLUMNS FROM mytable FROM mydb;
mysql>
SHOW COLUMNS FROM mydb.mytable;
SHOW COLUMNS
indicates the column name.
Field
indicates the column data type.
Type
Collation
is displayed only if you use the
The
field contains
Null
as of MySQL 5.0.3, and
The
field indicates whether the column is indexed:
Key
• If
is empty, the column either is not indexed or is indexed only as a secondary column in a
Key
multiple-column, nonunique index.
• If
is PRI, the column is a
Key
KEY.
• If
is UNI, the column is the first column of a unique-valued index that cannot contain
Key
values.
| big5
| dec8
| cp850
| hp8
| koi8r
| latin1
Syntax
tbl_name
displays information about the columns in a given table. It also works for views as of
[896]
clause, if present, indicates which column names to match. The
LIKE
Statements".
SHOW
| Type
| Null | Key | Default | Extra
| int(11)
| NO
| PRI | NULL
| char(35) | NO
|
| char(3)
| NO
| UNI |
| char(20) | YES
| MUL |
| NO
|
Section 13.1.10.3, "Silent Column Specification
db_name.tbl_name
displays the following values for each table column:
indicates the collation for nonbinary string columns, or
FULL
if
YES
NULL
before that.
''
PRIMARY KEY
Syntax
SHOW
|
1 | Yes
| Yes
|
3 | Yes
| Yes
|
4 | Yes
| Yes
|
6 | Yes
| Yes
|
7 | Yes
| Yes
|
8 | Yes
| Yes
[{FROM | IN} db_name]
| auto_increment |
|
|
|
|
| 0
|
as an alternative to the
keyword.
values can be stored in the column. If not, the column contains
or is one of the columns in a multiple-column
1176
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
|
|
|
|
CREATE TABLE
tbl_name FROM db_name
for other columns. This value
NULL
WHERE
Section 19.18,
statement, note
Changes".
syntax. In
NO
PRIMARY
NULL

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents