Are these same?

Database

Are these same?

Hi!

I need help in figuring out if both teh qry are same as far as logic is concerned. I have commented out the X2 and X3 portions and the number of rows returned when I run this and when I run the original query ( without commenting out ) , is the same. I want a second set of eyes to confirm that the logic remains the same even if I comment the X2 and X3 part of query.
Any help is appreciated.

--select X1.*, X2.PROD_ID, X3.PROD_arg_ID,X4.LN_arg_ID, X3.PRMY_C_ID
select X1.*, X4.PROD_ID, X4.PROD_arg_ID,X4.LN_arg_ID,
X4.PRMY_C_ID
from (
select B.PLN_no, C.C_no, C.SUBPLN_no, D.LN_no,
A.B_PP_D_ID, A.PRT_PP_D_ID, A.PRT_P_D_ID,
A.LN_A_D_ID, A.EFF_DT, A.DMD_OFFST_AMT, A.LST_UPDT_RUN_ID,
A.CREAT_RUN_ID, A.TOT_LN_IN_ARREAR_CT, A.TOT_EXPCT_INT_AMT,
A.CRNT_BAL_AMT, A.INT_IN_ARREAR_AMT, A.END_DT, A.DMD_OFFST_COMB_AMT,
A.BEGNG_LN_FUND_BAL_AMT, A.LN_ISS_AMT, A.ACTL_PRIN_AMT,
A.PMT_MADE_CT, A.INT_PD_AMT, A.PRIN_IN_ARREAR_AMT, A.DYS_IN_ARREAR_CT,
A.DMD_DISTRB_AMT, A.SKED_AMT, A.YTD_ACCUM_INT_AMT, A.LN_ISS_PRIN_AMT
from FCT A -- (18974478,628323)
, B_PP_D B, PRT_PP_D C,
LN_A_D D, PRT_P_D E
where A.PRT_PP_D_ID = C.PRT_PP_D_ID
and A.B_PP_D_ID = B.B_PP_D_ID
and D.LN_A_D_ID = A.LN_A_D_ID
and A.PRT_P_D_ID = E.PRT_P_D_ID
and A.END_DT = '2100-12-31'
) X1
/* inner join (
select PROD_ID, PLN_no
from PROD
where PROD_ID=PARNT_PROD_ID
and END_DT='2100-12-31'
) X2
on X1.PLN_no=X2.PLN_no
inner join (
select Prod.pln_no , Prod.subpln_no , cst.C_no ,J.prmy_C_id , max(Prod_arg_id) Prod_arg_id
from pln_p_arg J , cst , Prod
where J.end_dt = '2100-12-31'
and cst.end_dt = '2100-12-31'
and Prod.end_dt = '2100-12-31'
and Prod.Prod_id = J.Prod_id
and J.prmy_C_id = cst.cst_id
group by Prod.pln_no , Prod.subpln_no , cst.C_no , J.prmy_C_id
) X3
on X3.pln_no = X1.pln_no
and X3.subpln_no = X1.subpln_no
and X3.C_no = X1.C_no */
inner join (
select Prod.pln_no , Prod.subpln_no , cst.C_no ,
lnr.LN_no , max(ln_arg_id) ln_arg_id
,Prod.PROD_ID, max(Prod_arg_id) Prod_arg_id ,
PRMY_C_ID
from ln_arg lnr ,
PLN_P_ARG J , cst , Prod
where lnr.end_dt = '2100-12-31'
and cst.end_dt = '2100-12-31'
and Prod.end_dt = '2100-12-31'
and J.end_Dt='2100-12-31'
and Prod.Prod_id = lnr.Prod_id
and J.prmy_C_id = cst.cst_id
and J.PROD_arg_ID=LNR.ARG_BSNS_no
group by Prod.pln_no ,Prod.subpln_no , cst.C_no,
lnr.LN_no ,Prod.PROD_ID, PRMY_C_ID) X4
on X4.pln_no = X1.pln_no
and X4.subpln_no = X1.subpln_no
and X4.C_no = X1.C_no
and X4.ln_no = X1.ln_no

Thanks!