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

I was certain UNION (as opposed to UNION ALL) should remove duplicates and
the same with DISTINCT. To get the latter query to return one row, GROUP BY
can be added, I don't know how to make the first query return only one row.

Is this a Firebird error, and if so, is it a new one or one fixed in newer
versions?

Set
  • [firebird-s... Svein Erling Tysvær setys...@gmail.com [firebird-support]
    • [fireb... Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]
      • Re... Svein Erling Tysvær setys...@gmail.com [firebird-support]
    • [fireb... Tim Ward t...@telensa.com [firebird-support]
      • Re... Ann Harrison aharri...@ibphoenix.com [firebird-support]

Reply via email to