Pylon SQL - Get Doc Types
SELECT
HECOMMDOCTYPES.HEID,
HECOMMDOCTYPES.HECODE,
HECOMMDOCTYPES.HENAME,
'HECOMMDOCTYPES' AS TBL
FROM
HECOMMDOCTYPES
INNER JOIN HECOMPANIES ON HECOMMDOCTYPES.HECOMPID = HECOMPANIES.HEID
UNION ALL
SELECT
HEFINDOCTYPES.HEID,
HEFINDOCTYPES.HECODE,
HEFINDOCTYPES.HENAME,
'HEFINDOCTYPES' AS TBL
FROM
HECOMPANIES
INNER JOIN HEFINDOCTYPES ON HEFINDOCTYPES.HECOMPID = HECOMPANIES.HEID