Subject Re: Duplicates with LIST function in Fb 2.5.4?
Author Dmitry Yemanov
11.01.2016 11:49, Svein Erling Tysvær wrote:

> Hi, I'm puzzled by two queries returning duplicate rows:
>
> 1)
> SELECT LIST('Hi') FROM RDB$DATABASE
> UNION
> SELECT LIST('Hi') FROM RDB$DATABASE
>
> 2)
> WITH TMP(DuplicateRows) AS
> (SELECT LIST('Hi') FROM RDB$DATABASE
> UNION
> SELECT LIST('Hi') FROM RDB$DATABASE)
> SELECT DISTINCT DuplicateRows
> FROM TMP

LIST returns a blob. DISTINCT doesn't work with blobs properly, it
operates with blob ids (that are surely distinct) instead. See:

http://tracker.firebirdsql.org/browse/CORE-1345
http://tracker.firebirdsql.org/browse/CORE-1530


Dmitry