PostgreSQL学习笔记---如何包含有单引号的字符串
2016-11-28 10:55
351 查看
在PostgreSQL中,表示字符串时,用单引号将字符串包含起来。如 ‘foo’
如果字符串本身就包含单引号,就在有单引号的地方再加一个单引号。如要表示
这个字符串。则表示成
参考来源:
PostgreSQL 9.5官网文档
4.1. Lexical Structure
A string constant in SQL is an arbitrary sequence of characters bounded by single quotes (‘), for example ‘This is a string’.
To include a single-quote character within a string constant, write two adjacent single quotes, e.g., ‘Dianne”s horse’.
Note that this is not the same as a double-quote character (“).
如果字符串本身就包含单引号,就在有单引号的地方再加一个单引号。如要表示
O'Reilly
这个字符串。则表示成
'O''Reilly'
参考来源:
PostgreSQL 9.5官网文档
4.1. Lexical Structure
A string constant in SQL is an arbitrary sequence of characters bounded by single quotes (‘), for example ‘This is a string’.
To include a single-quote character within a string constant, write two adjacent single quotes, e.g., ‘Dianne”s horse’.
Note that this is not the same as a double-quote character (“).
相关文章推荐
- C#学习笔记—分析字符串中包含元素的类型
- Python学习笔记之疑问10:如何使用分隔符连接list中的字符串
- 【CodeSmith学习笔记】:特殊字符如何包含在模板中和模板引用其他文件
- 如何输出格式化的字符串(学习笔记四)
- 【TypeScript学习笔记】代码中反引号的作用-多行文本输入创建多行字符串
- python cookbook 学习笔记 -- 1.8 检查字符串中是否包含某字符集合中的字符
- php学习零散笔记—字符串分割、fetch函数和单双引号。
- 程序员编程艺术学习笔记(二)字符串是否包含问题
- 学习笔记二--如何:查询包含一组指定单词的句子 (LINQ)
- 【学习笔记】cocos2d 如何绘制一个字符串
- 程序员编程技术学习笔记——字符串包含
- python3.4学习笔记(十五) 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- 字符串的输入与停止(如何输入空字符串)(C++ primer 学习笔记)
- 黄聪:C#如何Json转字符串;字符串转Json;Newtonsoft.Json(Json.Net)学习笔记(转)
- 学习笔记6——字符,字符串,malloc()函数,单引号,双引号
- 学习笔记之TAOCP--字符串是否包含问题(学习“结构之法”博客)
- C++学习笔记之函数如何返回字符串(char型)
- C++学习笔记之函数如何返回字符串(char型)
- SQL Server 2005 : 存储过程传递字符串类型参数时,如何在参数中包含单引号
- 学习笔记一:如何:对某词在字符串中出现的次数进行计数 (LINQ)