title: Not equals when using CASE statement in SQL
body: <p>In postgresql, I have a <code>case</code> statement that I need to add a "not equals" clause.  </p>
  
  <p>When <code>v1</code> equals v2, I want it to say 1, when <code>v1</code> <strong>DOES NOT EQUAL</strong> <code>v2</code>, I would like to say 2.</p>
  
  <pre><code>create table test (
  v1      varchar(20),
  v2      varchar(20)
  );
  
  insert into test values ('Albert','Al'),('Ben','Ben')
  
  select case v1
  when v2 then 1
      else 3
  end 
  from test
  </code></pre>
  
  <p>I tried using <code>!=</code> or <code>&lt;&gt;</code>, but that does not seem to work.  </p>
  
  <p>Does anyone have any idea how to use not equals in a <code>case</code> statement in SQL?</p>