加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PostgreSQL学习笔记---如何包含有单引号的字符串

发布时间:2020-12-13 17:00:43 所属栏目:百科 来源:网络整理
导读:在PostgreSQL中,表示字符串时,用单引号将字符串包含起来。如 ‘foo’ 如果字符串本身就包含单引号,就在有单引号的地方再加一个单引号。如要表示 O 'Reilly 这个字符串。则表示成 'O' 'Reilly' 参考来源: PostgreSQL 9.5官网文档 4.1. Lexical Structure

在PostgreSQL中,表示字符串时,用单引号将字符串包含起来。如 ‘foo’

如果字符串本身就包含单引号,就在有单引号的地方再加一个单引号。如要表示

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 (“).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读