title: mysql not exists returns empty set
body: <p>I have a table called <strong>Today_UNIT_NAMES</strong> with the following column names:</p>
  
  <pre><code>id, unit_id, unit_name, name_type_id
  </code></pre>
  
  <p>there are <strong>4 name_type_id (1,2,3,4)</strong>.</p>
  
  <p>I want to write a query to find all of the <strong>unit_id</strong> that <strong>DO NOT</strong> have a <strong>unit_name</strong> with a <strong>name_type_id=4</strong> existing in the records.  Here is what i've tried.  It returns an empty set.</p>
  
  <pre><code>select `un`.`unit_id`
  from `Today_UNIT_NAMES` `un`
  where  NOT EXISTS(
             select `un`.`unit_id`
             from `Today_UNIT_NAMES` `un`
             where `un`.`name_type_id`='4'
         )
  order by `unit_id`
  </code></pre>