当前位置:Gxlcms > mysql > 【MySQL11】注释

【MySQL11】注释

时间:2021-07-01 10:21:17 帮助过:31人阅读

对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.gxlcms.com)!

人气教程排行