title: mysql, select rows that satisfy join and column value when join equals null
body: <p>I have two tables the first one called staff with columns id, name, defaultSel and the second called staffRels with columns id, staffID, etc. I want to select those rows from the staff table with a presence at the staffRels table along with those that do not appear in the staffRels table but have defaultSel column set to 1. i have the following so far but with not very good results giving me either a whole bunch of rows i don't want or less depending on how i format the case in the where clause. </p>
  
  <pre>SELECT staff.id, staff.name FROM staff 
  LEFT JOIN staffRels 
  ON staff.id = staffRels.staffID 
  WHERE CASE staffRels.id WHEN null THEN staff.defaultSel=1 ELSE staff.defaultSel=0 END </pre>
  
  <p>Anything to clear my view on how to do this? Thanks a lot!</p>