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

你可能感兴趣的文章
Qt笔记——获取位置信息的相关函数
查看>>
POJ 2484 A Funny Game(神题!)
查看>>
POJ 2486 树形dp
查看>>
POJ 2488:A Knight's Journey
查看>>
SpringBoot为什么易学难精?
查看>>
poj 2545 Hamming Problem
查看>>
poj 2723
查看>>
poj 2763 Housewife Wind
查看>>
Qt笔记——模型/视图MVD 文件目录浏览器软件
查看>>
POJ 2892 Tunnel Warfare(树状数组+二分)
查看>>
poj 2965 The Pilots Brothers' refrigerator-1
查看>>
poj 3026( Borg Maze BFS + Prim)
查看>>
POJ 3041 - 最大二分匹配
查看>>
POJ 3041 Asteroids(二分匹配模板题)
查看>>
Qt笔记——标准文件对话框QFileDialog
查看>>
poj 3083 Children of the Candy Corn
查看>>
POJ 3083 Children of the Candy Corn 解题报告
查看>>
POJ 3253 Fence Repair C++ STL multiset 可解 (同51nod 1117 聪明的木匠)
查看>>
Qt笔记——控件总结
查看>>
poj 3262 Protecting the Flowers 贪心
查看>>