MySQL 3.23 中文参考手册 |
|
|
|
| 2004-02-12 MySQL 译者:晏子 http://www.mysql.com/doc.html |
|
| |
MySQL服务器支持# to end of line、-- to end of line和/* in-line or multiple-line */注释风格:
mysql> select 1+1; # This comment continues to the end of line
mysql> select 1+1; -- This comment continues to the end of line
mysql> select 1 /* this is an in-line comment */ + 1;
mysql> select 1+
/*
this is a
multiple-line comment
*/
1;
注意--注释风格要求你在--以后至少有一个空格!
尽管服务者理解刚才描述的注释句法,mysql客户分析/* ... */注释的方式上有一些限制:
单引号和双引号字符被用来标志一个括起来的字符串的开始,即使在一篇注释内。如果引号在主室内没被第2个引号匹配,分析器不知道注释已经结束。如果你正在交互式运行mysql,你能告知有些混乱,因为提示符从mysql>变为'>或">。
一个分号被用来指出当前的SQL语句结束并且跟随它的任何东西表示下一行的开始。
当你交互式运行mysql时和当你把命令放在一个文件中并用mysql < some-file告诉mysql从那个文件读它的输入时,这些限制都适用。
MySQL不支持‘--’的ANSI SQL注释风格。见5.4.7 ‘--’作为一篇注释的开始。
|
| |
|
|
| |
|
发表评论
关闭窗口
|
|
|
|