I have 2 queries that I need to combine into 1 query. I need to bring back both datasets as If I ran them separately and Merged them together. Im thinking I could just do an OUTER JOIN but the guy Im working with suggested a UNION ALL and Im not sure which one is easier or better to use. Both queries params come from the same table Im looping through
Here are the 2 queries
Select ENDORSE_WC290303.NAME_OF_CLIENT From ENDORSE
INNER JOIN ENDORSE_WC290303 ON ENDORSE_WC290303.ENDORSE_ID = ENDORSE.ENDORSE_ID
WHERE ENDORSE.CARRID = :pCARRID AND ENDORSE.POLNBR = :pPOLNBR AND ENDORSE.COV_EFFDT = :pCOV_EFFDT AND ENDORSE.ENDORSE_CD_NBR = '123'
Select INSURED_NAME, i.COV_EFFDT, NAME_EXPDT, UI_NBR from INSURED_ENTITY where CVG_ID= :pCVG_ID AND POLNBR= :pPOLNBR AND COV_EFFDT = :pCOV_EFFDT ORDER BY COV_NAME_SEQ ASC
I need to Join the 2 tables and get back both of the result sets combined....Whats the best way to do this?