【Mysql 學習】字串

楊奇龍發表於2011-01-01

字串
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部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-683135/,如需轉載,請註明出處,否則將追究法律責任。

相關文章