SAM-2192 splitting up difficult sub-select into two separate queries. Patch from Chan J cleaned up by Sam O


git-svn-id: https://source.sakaiproject.org/svn/sam/trunk@128256 66ffb92e-73f9-0310-93c1-f5514f145a0a