博客
关于我
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/

你可能感兴趣的文章
Nginx 学习(一):Nginx 下载和启动
查看>>
nginx 常用指令配置总结
查看>>
Nginx 常用配置清单
查看>>
nginx 常用配置记录
查看>>
nginx 开启ssl模块 [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx
查看>>
Nginx 我们必须知道的那些事
查看>>
Nginx 源码完全注释(11)ngx_spinlock
查看>>
Nginx 的 proxy_pass 使用简介
查看>>
Nginx 的 SSL 模块安装
查看>>