I have 2 CTE.When i try to join them i get an error message "ORA-01789: ".how can i merge the 2 CTE.Is there any other way to get the desired result : WITH IMPORT_CTE 
AS  ((select A.*
FROM IMPORT_REGISTRY_ERROR_LOG_1 A
INNER JOIN (select distinct POD_ID,CONFLICTED_POD_ID,ERROR_CODE
             FROM IMPORT_REGISTRY_ERROR_LOG_1 
             GROUP BY POD_ID,CONFLICTED_POD_ID,ERROR_CODE
             HAVING COUNT(*) > 1) B
on  A.POD_ID = B.POD_ID AND A.CONFLICTED_POD_ID = B.CONFLICTED_POD_ID AND A.ERROR_CODE = B.ERROR_CODE  ) order by a.pod_id desc)
select t1.*
from IMPORT_CTE t1
where t1.insert_date =(select max(t2.insert_date)
                        from IMPORT_CTE t2
                       where t2.POD_ID =t1.POD_ID)
                

WITH IMPORT_CTE1 
AS  ((select A.*
FROM IMPORT_REGISTRY_ERROR_LOG_1 A
INNER JOIN (select distinct POD_ID,CONFLICTED_POD_ID,ERROR_CODE
             FROM IMPORT_REGISTRY_ERROR_LOG_1 
             GROUP BY POD_ID,CONFLICTED_POD_ID,ERROR_CODE
             HAVING COUNT(*) > 1) B
on  A.POD_ID = B.POD_ID AND A.CONFLICTED_POD_ID = B.CONFLICTED_POD_ID AND A.ERROR_CODE = B.ERROR_CODE  ) order by a.pod_id desc)
select t1.insert_date 
from IMPORT_CTE1 t1
where t1.insert_date =(select min(t2.insert_date)
                        from IMPORT_CTE1 t2
                       where t2.POD_ID =t1.POD_ID)
                