User Tools

Site Tools


techprivate:powerschool:specialprograms

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

techprivate:powerschool:specialprograms [2012/10/02 10:18]
afrink created
techprivate:powerschool:specialprograms [2012/10/02 10:31] (current)
afrink
Line 6: Line 6:
   * ELL: 5225   * ELL: 5225
   * Learning Center: 6213   * Learning Center: 6213
 +
 +===== Example SQL =====
 +
 +To pull most recent record for a program (LC in this example)
 +<code sql>
 +WITH
 +--get latest LC record
 +maxdates_lc as (
 +  SELECT studentid, max(enter_date) latest_date
 +  FROM spenrollments
 +  WHERE programid = 6213
 +  GROUP BY studentid
 +),
 +--pull only records from a certain date
 +lclist as (
 +  SELECT studentid, 1 as lc
 +  FROM maxdates_lc
 +  WHERE latest_date >= to_date('​2012-08-01',​ '​YYYY-MM-DD'​)
 +)
 +</​code>​
techprivate/powerschool/specialprograms.txt ยท Last modified: 2012/10/02 10:31 by afrink