ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【Mysql 学习】字符串

【Mysql 学习】字符串

原创 Linux操作系统 作者:杨奇龙 时间:2011-01-01 16:25:39 0 删除 编辑

字符串
mysql> SELECT "hello", "'hello'", "''hello''", "hel""lo", "\"hello";
+-------+---------+-----------+--------+--------+
| hello | 'hello' | ''hello'' | hel"lo | "hello |
+-------+---------+-----------+--------+--------+
| hello | 'hello' | ''hello'' | hel"lo | "hello |
+-------+---------+-----------+--------+--------+
1 row in set (0.01 sec)

mysql> SELECT 'This\nIs\nFour\nLines';
+--------------------+
| This
Is
Four
Lines |
+--------------------+
| This
Is
Four
Lines |
+--------------------+
1 row in set (0.00 sec)

mysql> SELECT 'This\nIs\nFour\nLines' line;
+--------------------+
| line               |
+--------------------+
| This
Is
Four
Lines |
+--------------------+
1 row in set (0.01 sec)

mysql> SELECT 'disappearing\ backslash';
+------------------------+
| disappearing backslash |
+------------------------+
| disappearing backslash |
+------------------------+
1 row in set (0.01 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22664653/viewspace-683135/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
MySQL DBA NoSQL DEVOPS

注册时间:2009-10-07

  • 博文量
    1026
  • 访问量
    8206008