鉴于 PostgreSQL 数据库中的以下两个表...
表observation
:
+---------------+---------+
| observationid | deleted |
+---------------+---------+
| 1 | F |
| 2 | F |
| 3 | F |
+---------------+---------+
表numericvalue
:
+---------------+-------+
| observationid | value |
+---------------+-------+
| 1 | 999 |
| 2 | 5 |
| 3 | 999 |
+---------------+-------+
每当关联行中包含等于时,我想将列的值设置deleted
为'T'
在所有行中。observation
numericvalue
value
999
SELECT
查询如下所示:
SELECT *
FROM observation o
INNER JOIN numericvalue n
ON o.observationid = n.observationid
AND n.value = 999;