Comment
Adds a comment or removes an existing comment for an existing table or column object.
COMMENT
Create or remove a comment for a TABLE
or COLUMN
object of name object_name
. The comment must be a string literal or NULL
. If NULL
, the comment is removed.
Only super-users or owners of the object can modify comments on the object.
Column and table comments can be viewed either in the information_schema
system tables, or in the result of the SHOW CREATE TABLE
command run on the relevant table.
Currently comments are not supported with the CREATE TABLE
command, and COMMENT ON
is the canonical means to set or unset comments.
Examples
Create a table and add a comments to it.
When specifying the name of the COLUMN
object, it must be of the form <TABLE>.COLUMN>
to uniquely identify it.
Show the comments and the DDL of the table.
Currently COMMENT ON
is supported only on tables and and columns of that table. Other objects such as VIEW
are not currently supported.
View the table and column comment in respective system table.
Last updated