我发现MySQL中有'comment'关键字。(没有注释语法,如/ * * /,#)
但是我不知道为什么会有'comment'关键字的原因。
如果有下表,我如何使用“注释”?
create table Employee(
id int not null auto_increment,
create_dt date comment 'the date when employee was hired'
salary int comment 'salary in EUR',
primary key (id)
) comment 'The employee table of company AA';
Run Code Online (Sandbox Code Playgroud)
注释是一种在数据库本身中存储相关信息的方法。例如,在列上添加注释将导致该注释由show create tableand show full columns命令显示。
请注意,这与大多数人认为的SQL注释不同 -它们只是脚本中的语句,在解析后会被忽略。它们不会进入任何元数据供以后检索。
| 归档时间: |
|
| 查看次数: |
801 次 |
| 最近记录: |