...
1)get a list of all inspections against a that specific aircraft,
2) identify the bad record,
...
SELECT SUBSTR(TO_CHAR(C07.AIRCRAFT_ID),1,8) AS ACID,
SUBSTR(Y02.AIRCRAFT_MARK_ID,1,4) AS MRK,
TO_CHAR(Y53.DATE_START_DTE,'YYYY-MM-DD') AS OWNER_START,
SUBSTR(GET_PARTY_INFO(Y53.PARTY_ID),1,25) AS OWNER,
TO_CHAR(DATE_INSPECT_DTE,'YYYY-MM-DD') AS INSPECTION_DATE,
SUBSTR(INSPECTED_BY_CD ,1,1) AS INBY, – (AMO OR AME)
SUBSTR(TRIM(INSPECTOR_AME_LICENSE_NUMBER_I ||
INSPECTOR_AMO_LICENSE_NUMBER_I ),1,12) || ' ' AS LICENSE_NO, --- (AMO OR AME number)
SUBSTR(INSPECTOR_NAME_OTHER_NM,1,25) AS WHO_INSPECTED
FROM C07_AIRCRAFT_INSPECTION C07 ,
...
Y02_AIRCRAFT_HISTORY Y02
WHERE Y53.AIRCRAFT_PARTY_LIST_ID = C07.AIRCRAFT_ID
AND Y02.AIRCRAFT_ID = C07.AIRCRAFT_ID
AND Y02.RUN_ID = 99
AND Y53.DATE_STOP_DTE IS NULL
AND C07.AIRCRAFT_ID IN (SELECT AIRCRAFT_ID FROM Y93_CCARCS_PREVIOUS_DAY
WHERE MARK IN ( 'FBQJXXXX'))
AND C07.INSPECTION_TYPE_CD = 2
ORDER BY Y02.AIRCRAFT_MARK_ID, C07.DATE_INSPECT_DTE DESC ;
...