SELECT UNIQUE
  CRL.CALIB_TABLE, CUS.PROCESS_RUN, CRL.CID, CUS.JOBSET, CTP.SYSTEM
FROM
  PASSES CPS,
  PASSCALIBS CPSC,
  USED_SETS CUS,
  SET_RUN_MAPS CSRM,
  CALIBRUNLISTS CRL,
  CALIB_PROPERTIES CTP
WHERE CPS.RETIRED IS NULL
  AND CPS.PASS_INDEX = CPSC.PASS_INDEX
  AND CPSC.PROC_CALIB_VERSION = CUS.PROC_CALIB_VERSION
  AND CUS.PROCESS_RUN BETWEEN CPSC.LORUN AND CPSC.HIRUN
  AND CPS.PROCESS_NAME = CUS.PROCESS_NAME
  AND CUS.JOBSET = CSRM.JOBSET
  AND CSRM.CID = CRL.CID
  AND CRL.CALIB_TABLE = CTP.CALIB_TABLE
  AND CRL.CALIB_TABLE NOT IN (
    'COTSTAGE0','SICHIPPED','SICHIPTHRESH','SIDPSPARMS',
    'COTCHANT0','SISTRIPDH')
  AND CPS.PROCESS_NAME = 'PROD_PHYSICS_CDF'
  AND CPS.PASSNAME = '16'
  AND CPSC.LORUN >= 138000 
  AND CPSC.LORUN <= 139333
  AND CPSC.LORUN != 138617
  AND CPSC.LORUN != 139249
ORDER BY CRL.CALIB_TABLE, CUS.PROCESS_RUN;
