我想在SQL代码中添加注释。我该怎么做呢?我使用的是MySQL。
发布于 2012-02-01 23:40:39
发布于 2012-02-02 00:46:00
“可以使用COMMENT
选项指定列的注释。注释由SHOW CREATE TABLE
和SHOW FULL COLUMNS
语句显示。此选项从MySQL 4.1开始可操作。(在早期版本中允许使用,但会被忽略。)”
举个例子
--
-- Table structure for table 'accesslog'
--
CREATE TABLE accesslog (
aid int(10) NOT NULL auto_increment COMMENT 'unique ID for each access entry',
title varchar(255) default NULL COMMENT 'the title of the page being accessed',
path varchar(255) default NULL COMMENT 'the local path of teh page being accessed',
....
) TYPE=MyISAM;
发布于 2012-02-01 23:41:00
您可以使用单行注释:
-- this is a comment
# this is also a comment
或多行注释:
/*
multiline
comment
*/
https://stackoverflow.com/questions/9098655
复制相似问题