Visual Designer

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"
;

Easiest way to add a table or tables is by dragging them from the Object Explorer (or Object Palette) to the Visual Query Builder diagram. If parent-child relationships are defined with the tables already in the visual diagram, then the table/s will be added with join conditions added automatically to those tables. If parent-child relationships are not defined, then you can add join conditions by dragging a column from one table to an appropriate column of the other table.

Another way to add related tables and their join conditions is to right-click a specific table and choose "Add Linked Tables from Database". See screen snap below.

Lastly, you can double-click any join line to bring up its properties (or Right-click on the join in the LHS Query Browser and choose "Properties"). This brings up a panel in which you can define Left/Right/Full outer join conditions, etc.