nikolasd
10/26/2017 - 1:23 PM

Get Doc Types

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