title: case when statements in sap hana
body: <p>I would like to know what can I use to be able to do:</p>
  
  <blockquote>
    <p>If condition1 true then only display condition 1 value else go to
    condition 2 and display only condition 2 value.</p>
  </blockquote>
  
  <p>I have tried to use case when but this seems to be executing both WHEN statements(and this is because both cases exist in the table but i want only the first when to return if both are true). Is there a way to do this?</p>
  
  <pre><code>SELECT 
  RI.*,
  CASE 
  WHEN
    ("applianceId" 
     in 
     ('AlwaysOn','Heating','Cooling','Pool Pump','Hot Water') 
     and "type" in ('peer')) 
  THEN 'Measured' 
  ELSE 
     ("applianceId" 
     NOT in 
     ('AlwaysOn','Heating','Cooling','Pool Pump','Hot Water') 
     and "type" IN('peer')) 
  THEN 'RELEVANCE' 
  ELSE 'ERROR'
  END AS "Select" FROM "SP_CUSTOMER"."RU_INSIGHT" RI
  where RI."userId" in 
  ('2270BAF2D64948A7031F620645577C82B7529BB26DA46453B4595F0BE61460D6')
  and "type" in ('peer')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mWLZu.png" rel="nofollow noreferrer">current output that i am getting</a></p>
  
  <p><a href="https://i.stack.imgur.com/XUifx.png" rel="nofollow noreferrer">desired output</a></p>