SELECT
	*
FROM
	(
		SELECT
			hh.*
		FROM
			custport_from_aai_header_history AS hh INNER JOIN
			custport_from_aai_detail_history AS dh ON hh.claim_id = dh.claim_id
		WHERE
			hh.claims_process_status IN ('13','14')
	) AS approve LEFT JOIN
	(
		SELECT
			*
		FROM
			custport_from_aai_header_history AS v
		WHERE
			v.claims_process_status IN ('11','12')
	) AS v ON approve.claim_id = v.claim_id
WHERE
	v.id_from_aai_header_history IS NULL
ORDER BY
	approve.received_date

SELECT
	*
FROM
	custport_from_aai_header_history
WHERE
	claim_register IN ('C1810000072','C1810000101','C1810000100','C1810000099','C1810000098','C1810000097')