Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter session types by terms #1726

Merged
merged 2 commits into from
Jan 26, 2017
Merged

filter session types by terms #1726

merged 2 commits into from
Jan 26, 2017

Conversation

stopfstedt
Copy link
Member

@stopfstedt stopfstedt commented Jan 25, 2017

refs #1725.

the SQL equivalent of this filter is

SELECT DISTINCT st.* 
FROM session_type st
JOIN session s ON s.session_type_id = st.session_type_id
LEFT JOIN session_x_term sxt ON sxt.session_id = s.session_id
LEFT JOIN term t ON t.term_id = sxt.term_id
LEFT JOIN course c ON c.course_id = s.course_id
LEFT JOIN course_x_term cxt ON cxt.course_id = c.course_id
LEFT JOIN term t2 ON t2.term_id = cxt.term_id
WHERE (
  t2.term_id IN (?) 
  OR t.term_id IN (?)
);

@jrjohnson jrjohnson merged commit 50a57c6 into ilios:master Jan 26, 2017
@stopfstedt stopfstedt deleted the 1725_terms branch December 4, 2017 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants