In MySQL I can perform the query I pastebin here. This query results the following result set:
How can I do something like it against a Firebird database?
Add from RDB$DATABASE to the end of your query - see here.
from RDB$DATABASE