title: where not exists clause sql
body: <p>So I am trying to list students that are in at least one class but are not part of a group. My code is showing up 0 results but there should be two. Something is wrong with my where clause. I can get it to show students taking one or more classes, just cant get it to show the ones that are also not part of any group. There is something wrong with my where clause. I have 3 tables that are related. Student which holds student name and ID, Member of, which holds student ID and group ID, and studentgroup which holds group ID.</p>
  
  <p>Code:</p>
  
  <pre><code>select student.lastname
  from student inner join enrolled on enrolled.studentid = student.sid
  where not exists(
  select *
  from studentgroup inner join memberof on memberof.groupid = studentgroup.gid 
  )
  </code></pre>