Posts

Showing posts with the label PL

PowerSchool - Query Oracle DB to get a list of students with their siblings

In Oracle database of PowerSchool, to get a list of students with their siblings who also students, you can use the following query: The important parts of the above query are: * Group the students of a same family based on the FAMILY_IDENT column of the STUDENTS table: SELECT STUDENTS.FAMILY_IDENT AS FAMILY_IDENT, '<ul>' || listagg('<li>' || STUDENTS.LASTFIRST || ' (' || STUDENTS.GRADE_LEVEL || ')' || ',</li>', '')  WITHIN GROUP ( ORDER BY STUDENTS.GRADE_LEVEL DESC, Upper(Trim(STUDENTS.LASTFIRST)) ) || '</ul>' AS SIBLINGS FROM STUDENTS WHERE STUDENTS.ENROLL_STATUS = 0 GROUP BY STUDENTS.FAMILY_IDENT The result will be something like this: ------------------------------------------------------------------------------------------------------- | FAMILY_IDENT | SIBLINGS                                                 ...