postgresql - 如何删除行名称带有“。”的行
问题描述
我有这张桌子:
id | key | value
----+---------------------------+--------------------------------------
1 | insight.enabled | true
3 | customer_id | 2720f38b-c999-4f29-ba32-4da851c58d06
4 | eula_accepted | true
5 | insight.mandatory_confirm | true
6 | automation.enabled | true
7 | automation.enabled | false
8 | automation.enabled | false
当我执行以下命令时,我想删除 automation.enabled row :
delete from configuration where automation.enabled='false';
我收到以下错误消息:
ERROR: missing FROM-clause entry for table "automation"
LINE 1: delete from configuration where automation.enabled='false';
我怎样才能逃脱'。作为列名的一部分?
解决方案
条件需要一列。automation.enabled
是特定行中的值。因此,您需要的是:
DELETE from configuration where key = 'automation.enabled' AND value = 'false';
推荐阅读
- apollo - gatsby-source-graphql 好像没有传cookie header,怎么解决?
- javascript - 以最小订单实时计算表格
- python - PermissionError:[Errno 13] 权限被拒绝:'pro.csv'
- sql - 如何并排输出重复的患者
- java - 如何使用 Java 或 kotlin 在结果集中进行查询
- mysql - 在 MySQL 中存储混合数据数组的最佳方式是什么?
- php - 如何使用 Twig 的 Intl 扩展提高百分比格式的小数精度?
- powerbi - DAX 中 SUMMARIZE 函数的替代方法
- java - 如何在 gluon Mobil 上使用 java11 和 java11 编译库?
- logging - 将数据从 Azure 监视器传输到 Azure SQL 数据库