欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

【MySQL 11】注释

程序员文章站 2022-06-05 23:25:42
...
对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 | *    |
|  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 | *    |
|  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 | *    |
|  3 | Bobe | male |   25 | ximan     ||  4 | Kity | fama |   20 | beijing   |
+----+------+------+------+-----------+


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

相关标签: MySQL ,注释