Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个表,其中有一列包含一个数组(tags现在让我们调用它)。
tags
如何从该表中选择数组列不包含某个标记的所有行?
您可以尝试以下方法:
SELECT * FROM your_table WHERE 'certain tag' != ALL (tags);
一种方法是获取包含该标签的所有 id,然后您可以使用子查询排除那些:
SELECT * FROM foo WHERE id NOT IN ( SELECT id FROM foo WHERE tags @> ['specific-tag-here', 'other-tag-here']);