假设我有这样的查询:
SELECT name, GROUP_CONCAT(number)
FROM objects
GROUP BY name
它输出:
+----------+----------------------+
| NAME | GROUP_CONCAT(NUMBER) |
+----------+----------------------+
| false_1 | 2,1 |
| false_2 | 3,4 |
| true_1 | 4,3,2,1 |
| true_2 | 2,3 |
+----------+----------------------+
现在我如何返回具有2 AND 3
as 的行number
?
注意:此查询是分组的 - 表有 10 行,如下所示:
+---------+--------+
| NAME | NUMBER |
+---------+--------+
| true_1 | 1 |
| true_1 | 2 |
| true_1 | 3 |
| ... | ... |
+---------+--------+