I'm trying to learn the visual designer. I can't seem to use it to build this query. Basically, how do you add a join in the visual designer.
Select *
from
(
select PHRDEDN.PHRDEDN_BDCA_CODE "Deduct_Code",
PTRBDCA.PTRBDCA_LONG_DESC "Description",
count(phrdedn_pidm) "Employee_Counts",
sum(phrdedn_employee_amt) "Employee_Deduct",
sum(phrdedn_employer_amt) "Employer_Deduct",
sum(phrdedn_arrear_taken) "Arrears_Taken",
sum(phrdedn_arrear_recovered) "Arrears_Recovered",
sum(phrdedn_applicable_gross) "Gross_Pay"
from PAYROLL.PHRDEDN PHRDEDN, PAYROLL.PTRBDCA PTRBDCA
where ( PHRDEDN.PHRDEDN_BDCA_CODE = PTRBDCA.PTRBDCA_CODE )
and ( PHRDEDN.PHRDEDN_YEAR = 2024
and PHRDEDN.PHRDEDN_PAYNO = 20
)
group by PHRDEDN.PHRDEDN_BDCA_CODE, PTRBDCA.PTRBDCA_LONG_DESC
order by PHRDEDN.PHRDEDN_BDCA_CODE
) J1
Left Join
(
select sum(phrdedn_applicable_gross), PHRDEDN_BDCA_CODE
from PHRDEDN
where PHRDEDN.PHRDEDN_YEAR = 2024
Group by PHRDEDN_BDCA_CODE
) J2
on J2.PHRDEDN_BDCA_CODE = J1."Deduct_Code"
;