【MySQL 11】注释

黄舟
发布: 2017-02-04 13:36:33
原创
1276 人浏览过

对MySQL代码进行阅读的时候,发现需要添加注释:

mysql注释符有三种:

1、#… 
2、”- - …” 
3、/…/
登录后复制

依次测试:

1、#…

mysql> select * from person;    #chazhao
+----+------+------+------+-----------+| id | name | sex  | age  | addr      |
+----+------+------+------+-----------+|  1 | Jone | fema |   27 | xianggang |
|  2 | Lily | fema |   25 | taiwan    |
|  3 | Bobe | male |   25 | ximan     ||  4 | Kity | fama |   20 | beijing   |
+----+------+------+------+-----------+
登录后复制

2、”- - …”

mysql> select * from person;    --chazhao
+----+------+------+------+-----------+| id | name | sex  | age  | addr      |
+----+------+------+------+-----------+|  1 | Jone | fema |   27 | xianggang |
|  2 | Lily | fema |   25 | taiwan    |
|  3 | Bobe | male |   25 | ximan     ||  4 | Kity | fama |   20 | beijing   |
+----+------+------+------+-----------+
登录后复制

3、/*…*/

mysql> select */*chazhoa*/ from person; --chazhao
+----+------+------+------+-----------+| id | name | sex  | age  | addr      |
+----+------+------+------+-----------+|  1 | Jone | fema |   27 | xianggang |
|  2 | Lily | fema |   25 | taiwan    |
|  3 | Bobe | male |   25 | ximan     ||  4 | Kity | fama |   20 | beijing   |
+----+------+------+------+-----------+
登录后复制


以上就是 【MySQL 11】注释的内容,更多相关内容请关注PHP中文网(www.php.cn)!


相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板