title: SQL Server / Report Builder subquery returns more than one row error
body: <p>I'm struggling to figure out why a subquery in report builder is returning more than one row.</p>
  
  <pre><code>(
      SELECT 
      (
          CASE
              WHEN C.CourseCode IN ('50089079','50089080') THEN 'L2 Maths FS'
              WHEN C.CourseCode IN ('50089067','50089109') THEN 'L1 Maths FS'
              WHEN C.CourseCode IN ('50084987','50092959') THEN 'E3 Maths FS'
              WHEN C.CourseCode IN ('50084975','50091967') THEN 'E2 Maths FS'
              WHEN C.CourseCode IN ('50084963','50091724') THEN 'E1 Maths FS'
              WHEN C.CourseCode IN ('60146084') THEN 'GCSE Maths'
              Else 'NA'
          END
      )
      FROM
          Enrolment E
      INNER JOIN 
          Course C ON C.CourseID = E.CourseID
      WHERE 
          E.PMStudentID = vReports_Enrolment.PMStudentID
          AND C.CourseCode IN ('50089079', '50089080', '50089067', '50089109', '50084987', '50092959', '50084975', '50091967', '50084963', '50091724', '60146084')
          AND vReports_Enrolment.CompletionID = 1
  ) 
  </code></pre>
  
  <p>This is the data for a specific learner where this error is popping up - I've highlighted where there would usually be 2 rows returned if not for the CompletionID being checked to see if it's '1':</p>
  
  <pre><code>CourseCode  CompletionID  
  -------------------------
  50044357    1 
  50044369    1
  50089079    0   
  60146084    1
  60187578    1
  60148366    1
  </code></pre>
  
  <p>The expected behavior in this case is to return 'GCSE Maths'  - am I doing something wrong?</p>