博客
关于我
Postgresql:删除及查询字段中包含单引号的数据
阅读量:465 次
发布时间:2019-03-06

本文共 288 字,大约阅读时间需要 1 分钟。

PostgreSQL 数据库操作指南:处理包含单引号的字段

1. 删除固定值的单引号

在PostgreSQL中,当字段值是固定的单引号时,可以直接使用delete命令,并通过E'转义单引号。

示例:

delete from t_info where att = E’“test”’;

2. 删除包含单引号的动态值

如果字段值是动态的单引号,可以使用like操作来匹配包含单引号的值。同样需要使用E'来转义单引号。

示例:

delete from t_info where atts like E’%’;

参考资料

以上操作均基于PostgreSQL数据库的标准语法和最佳实践。

转载地址:http://xbfbz.baihongyu.com/

你可能感兴趣的文章
php curl_init函数用法(http://blog.sina.com.cn/s/blog_640738130100tsig.html)
查看>>
php curl_multi批量发送http请求
查看>>
php curl请求微信发红包接口出现错误:Peer's Certificate issuer is not recognized.
查看>>
PHP curl请求错误汇总和解决方案
查看>>
php declare(ticks=1)
查看>>
UVA 10474
查看>>
php echo 输出 锘?... 乱码问题
查看>>
PHP empty、isset、isnull的区别
查看>>
ReferenceQueue的使用
查看>>
PHP FastCGI进程管理器PHP-FPM的架构
查看>>
referenceQueue用法
查看>>
Springboot处理跨域的方式(附Demo)
查看>>
php flush()刷新不能输出缓冲的原因分析
查看>>
Referenced classpath provider does not exist: org.maven.ide.eclipse.launchconfig
查看>>
Refactoring-Imporving the Design of Exsiting Code — 代码的坏味道
查看>>