Forum Moderators: open
SELECT
'ID' AS "Record Type",
"CSL_STD_DEMO_DISTRICT"."ID_SET_SCHOOL_NAME" AS "Current School Code",
"CSL_STD_DEMO_SCHOOL"."HomeSchDistrict" AS "Resident District Code",
"CSL_STD_DEMO_DISTRICT"."LAST_NAME",
From CSL_STD_DEMO_DISTRICT
LEFT join CSL_STD_DEMO_SCHOOL ON CSL_STD_DEMO_DISTRICT.ID_STD_DEMO_DISTRICT = CSL_STD_DEMO_SCHOOL.ID_STD_DEMO_DISTRICT
where GRADE_DESC!= 'Graduated' AND "CSL_STD_DEMO_DISTRICT"."ID_SET_SCHOOL_NAME" = '5008' AND CSL_STD_DEMO_SCHOOL.ACTIVE_STATUS='Y'
There is a 3rd table I would like to Join to this queary. The table is called CDM_SET_HOMESCHDISTRICT. In the 4th line of my query above, I would like to display the CDM_SET_HOMESCHDISTRICT.HOMESCHDISTRICT_CODE instead of HOMESCHDISTRICT based on:
"CSL_STD_DEMO_SCHOOL"."HomeSchDistrict" = " "CDM_SET_HomeSchDistrict"."ID_SET_HOMESCHDISTRICT"
CDM_SET_HOMESCHDISTRICT contains a column called HOMESCHDISTRICT_CODE that I would like returned instead of "CSL_STD_DEMO_SCHOOL"."HomeSchDistrict"
Hopefully this makes sense and someone will be able to offer some guidance on this.