我正在使用 Firebird 数据库 v2.5,但是我无法从我的查询中删除重复行:
SELECT DISTINCT u.id_user,
(SELECT LIST(g.id_user)
from gen g
where g.id_user=u.id_user
GROUP BY id_user) as list_g_user
FROM users u
where u.id_user = 1
INNER JOIN ...
这是我的结果:
id_user | list_g_user
===================================
1 | 437,499,718,739,835,865
1 | 437,499,718,739,835,865
1 | 437,499,718,739,835,865
1 | 437,499,718,739,835,865
第二列的结果
list_g_user
是一个BLOB类型。同样的结果有多行。有人能解释一下原因吗?
这是函数参考文献:Firebird Documentation: LIST()
GROUP BY id_user,list_g_user
并查看是否有效。 - JNevillselect u.id_user, list(g.id_user) from users u join gen g on .. where ... group by u.id_user
? - user330315