Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select distinct g.name
- , g.id
- , x.dcid
- , s.lastfirst
- , s.enroll_status
- , x.enter_date
- , x.code1
- , x.code2
- , x.exit_date
- , x.exitcode
- , x.schoolid
- , x.gradelevel
- , x.studentid
- from ps.spenrollments x
- join ps.students s
- on (s.dcid = x.dcid)
- join ps.terms t on x.enter_date < t.lastday
- and coalesce(x.exit_date, t.firstday) >= t.firstday
- and t.schoolid = s.schoolid
- and t.isyearrec = 1
- join ps.gen g
- on (g.id = x.programid and g.cat = 'specprog')
- where 1=1
- and t.yearid = 28
- and g.id = 6532
- and s.enroll_status in (0,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement