SoR joins


Thu May 20 2021 18:48:25 GMT+0000 (UTC)

Saved by @tinabuz #mysql

IFNULL(tppp.preferredname, 'WA') AS 'SOR'
FROM person p
JOIN student_program sp ON sp.personid=p.personid AND sp.statusid=1 AND sp.is_deleted=0
JOIN enrollment e ON e.personid=p.personid
JOIN enrollmenttostudentdebit esd USING (enrollmentid)
JOIN studentdebit sd USING (studentdebitid)
LEFT JOIN studentdebit asd ON asd.adjustsdebitid=sd.studentdebitid AND asd.obsolete=0
LEFT JOIN thirdpartypayerengagement tppe ON tppe.tppengagementid=sd.tppengagementid
LEFT JOIN thirdpartypayer tpp ON tpp.tppayerid=tppe.tppayerid
LEFT JOIN person tppp ON tppp.personid=tpp.tppayerpersonid

how to get student SoR