title: Simplifying a query into cases
body: <p>Here's the query as it stands so far:</p>
  
  <pre><code>select `formeid`, `name`, 'm' as `gender` from `data_pokemon`
      where `genders` not like '0|_' and `formeid` not in
          (select `formeid` from `dex` where `userid`=@userid and `gender`='m')
  union
  select `formeid`, `name`, 'f' as `gender` from `data_pokemon`
      where `genders` not like '_|0' and `formeid` not in
          (select `formeid` from `dex` where `userid`=@userid and `gender`='f')
  union
  select `formeid`, `name`, 'n' as `gender` from `data_pokemon`
      where `genders`='0|0' and `formeid` not in
          (select `formeid` from `dex` where `userid`=@userid and `gender`='n')
  order by `formeid`
  </code></pre>
  
  <p>As you can see, there's a lot of repetition. Is there any way to simplify this query so there isn't so much going on?</p>