Subject GROUP BY optional with constants?
Author Svein Erling Tysvær

I did a mistake with a query I wrote (Fb 2.5.3 or 2.5.4), but to my surprise Firebird did not complain and gave me the desired result. What I found was that whilst Firebird complains about missing GROUP BY if writing something like

 

SELECT ‘This does not work’, RDB$RELATION_ID, list(RDB$CHARACTER_SET_NAME)

FROM RDB$DATABASE

 

It does not complain if constants are used:

 

SELECT ‘This works’, list(RDB$CHARACTER_SET_NAME)

FROM RDB$DATABASE

 

or even

 

SELECT ‘This works’, RDB$RELATION_ID,  list(RDB$CHARACTER_SET_NAME)

FROM RDB$DATABASE

GROUP BY 2

 

Now, I do not object to not having to write GROUP BY – I’m just very surprised that it seems to be optional with constants. Is there any particular reason, or is this a ‘bug to be appreciated rather than fixed’?

Set