在 SQL 中,字符串使用的是單引號。
例如:刪除名字為 tom 的學生
delete from student where name='tom';
如果字符串本身也包括單引號,則使用兩個單引號(注意,不是雙引號,字符串中的雙引號不需要另外轉義)。
例如:刪除名字為 tom's senior 的學生
delete from student where name='tom'' senior';
在 SQL 中,字符串使用的是單引號。
例如:刪除名字為 tom 的學生
delete from student where name='tom';
如果字符串本身也包括單引號,則使用兩個單引號(注意,不是雙引號,字符串中的雙引號不需要另外轉義)。
例如:刪除名字為 tom's senior 的學生
delete from student where name='tom'' senior';