本篇内容主要讲解“MySQL怎么插入特殊字符”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“MySQL怎么插入特殊字符”吧!
有时候在插入字符的时候,经常会发现',"很难插进去。在MYSQL里用就OK了。
举例如下:
mysql> create table new (name varchar(200));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into new values('wt's test');
'>
'> ;
'> ';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's test');
;
'' at line 1
mysql> insert into new values('wt's test');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> insert into new values('wt"s test');
Query OK, 1 row affected (0.00 sec)
mysql> select * from new;
+-----------+
| name |
+-----------+
| wt's test |
| wt"s test |
+-----------+
2 rows in set (0.00 sec)
到此,相信大家对“MySQL怎么插入特殊字符”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!