Skip to content

Instantly share code, notes, and snippets.

@maclover7
Created July 6, 2015 20:54
Show Gist options
  • Save maclover7/4d0348f2df88353b4abc to your computer and use it in GitHub Desktop.
Save maclover7/4d0348f2df88353b4abc to your computer and use it in GitHub Desktop.
# Lesson.joins(:contents).where("contents.curriculum_id" = ?", "3280")
SELECT curriculum_id FROM Contents
WHERE curriculum_id IN
(SELECT curriculum_id FROM Contents
GROUP BY curriculum_id HAVING COUNT (curriculum_id) >1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment