Skip to content

Instantly share code, notes, and snippets.

@martinusso
Created August 9, 2013 20:01
Show Gist options
  • Save martinusso/6196711 to your computer and use it in GitHub Desktop.
Save martinusso/6196711 to your computer and use it in GitHub Desktop.
select domains - Firebird
SELECT
RDB$FIELDS.RDB$FIELD_NAME
FROM
RDB$FIELDS
INNER JOIN RDB$RELATION_FIELDS
ON (RDB$RELATION_FIELDS.RDB$FIELD_SOURCE = RDB$FIELDS.RDB$FIELD_NAME)
WHERE
RDB$FIELDS.RDB$SYSTEM_FLAG = 0
GROUP BY
RDB$FIELDS.RDB$FIELD_NAME
-- with the code below we have unused domains
HAVING
COUNT(RDB$RELATION_FIELDS.RDB$FIELD_SOURCE) = 0
-- with the code below we have used domains
HAVING
COUNT(RDB$RELATION_FIELDS.RDB$FIELD_SOURCE) > 0
@danielkort
Copy link

danielkort commented Jan 10, 2018

Obs no unused alter left join

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment