Hi blom,
Thank you. But this problem I am seeing only with 1 particular package. I have checked same scenario with different package and I don't see this problem.
Even without fact the SQL has group by.
Please find below for the query with group by
SELECT "Compensation"."Compensation_Plan_ID" (NAMED "Compensation_Plan_Namekey" ) ,
"Compensation"."Compensation_Plan_Name" (NAMED "Compensation_Plan_Name0" ) ,
"Customer"."Business_Unit_Code" (NAMED "Business_Unit_Codekey" )
FROM ( (
SELECT "COMP_PLAN_ELMNT_RFRNC"."Comp_Plan_Id" (NAMED "Compensation_Plan_ID" ) ,
"COMP_PLAN_ELMNT_RFRNC"."Comp_Plan_Elmnt_Id" (NAMED "Compensation_Plan_Element_ID" ) ,
"COMP_PLAN_RFRNC"."Comp_Plan_Name" (NAMED "Compensation_Plan_Name" )
FROM "EDWIT1E_VW40_DLR_COMP"."COMP_PLAN_ELMNT_RFRNC" "COMP_PLAN_ELMNT_RFRNC" ,
"EDWIT1E_VW40_DLR_COMP"."COMP_PLAN_RFRNC" "COMP_PLAN_RFRNC" ,
"EDWIT1E_VW40_DLR_COMP"."COMP_TP_RFRNC" "COMP_TP_RFRNC" , "EDWIT1E_VW40_DLR_COMP"."COMP_CTGRY_RFRNC" "COMP_CTGRY_RFRNC"
WHERE "COMP_PLAN_RFRNC"."Comp_Plan_Id" = "COMP_PLAN_ELMNT_RFRNC"."Comp_Plan_Id"
AND "COMP_TP_RFRNC"."Comp_Tp_Id" = "COMP_PLAN_ELMNT_RFRNC"."Comp_Tp_Id"
AND "COMP_TP_RFRNC"."Comp_Ctgry_Id" = "COMP_PLAN_ELMNT_RFRNC"."Comp_Ctgry_Id"
AND "COMP_TP_RFRNC"."Comp_Ctgry_Id" = "COMP_CTGRY_RFRNC"."Comp_Ctgry_Id" ) "Compensation" INNER JOIN (
SELECT "COMP_PYBL_FACT"."Cstmr_Id" (NAMED "Customer_ID" ) , "COMP_PYBL_FACT"."Comp_Plan_Id" (NAMED "Compensation_Plan_ID" ) ,
"COMP_PYBL_FACT"."Comp_Plan_Elmnt_Id" (NAMED "Compensation_Plan_Element_ID" ) ,
"COMP_PYBL_FACT"."Comp_Payable_Apprd_Dt" (NAMED "c23" )
FROM "EDWIT1E_VW40_DLR_COMP"."COMP_PAYABLE_FACT" "COMP_PYBL_FACT" ) "Compensation_Payable_Fact"
ON "Compensation"."Compensation_Plan_ID" = "Compensation_Payable_Fact"."Compensation_Plan_ID"
AND "Compensation"."Compensation_Plan_Element_ID" = "Compensation_Payable_Fact"."Compensation_Plan_Element_ID" ) LEFT OUTER JOIN (
SELECT "CSTMR_ROU_HIST"."Cstmr_Id" (NAMED "Customer_Id" ) , "ROU_RFRNC"."BU_Cd" (NAMED "Business_Unit_Code" ) ,
"CSTMR_ROU_HIST"."Cstmr_ROU_Start_Dt" (NAMED "Customer_ROU_Start_Date" ) ,
"CSTMR_ROU_HIST"."Cstmr_ROU_End_Dt" (NAMED "Customer_ROU_End_Date" )
FROM "EDWIT1E_VW40_DLR_COMP"."CSTMR_ROU_HIST" "CSTMR_ROU_HIST" ,
"EDWIT1E_VW40_DLR_COMP"."ROU_RFRNC" "ROU_RFRNC" , "EDWIT1E_VW40_DLR_COMP"."INTGS_SGMNT" "INTGS_SGMNT"
WHERE "ROU_RFRNC"."ROU_Id" = "CSTMR_ROU_HIST"."Cstmr_ROU_Id"
AND "INTGS_SGMNT"."GL_Cntr_Cd" = "ROU_RFRNC"."GL_Cntr_Cd" ) "Customer"
ON "Compensation_Payable_Fact"."Customer_ID" = "Customer"."Customer_Id"
AND "Compensation_Payable_Fact"."c23" BETWEEN "Customer"."Customer_ROU_Start_Date"
AND "Customer"."Customer_ROU_End_Date"
GROUP BY "Compensation"."Compensation_Plan_ID" , "Compensation"."Compensation_Plan_Name" ,
"Customer"."Business_Unit_Code
cheers,
Sudheer