在MySQL中,如果想要插入包含单引号的字符串,需要将单引号进行转义。可以使用双单引号(‘’)或者使用反斜杠(\)来转义单引号。例如:
INSERT INTO table_name (column_name) VALUES ('It''s a string with single quote');
或者
INSERT INTO table_name (column_name) VALUES ('It\'s a string with single quote');
这样就可以成功插入包含单引号的字符串了。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>