title: postgresql: how to get three rows with three different conditions at once from same table
body: <p>I have a table <code>table1</code>. with columns <code>sn</code>, <code>rt</code> and <code>type</code></p>
  <p>I want to get rows with different <code>rt</code> (i.e rt = 1,2,3) column conditions</p>
  <pre><code>(SELECT *
  FROM table1
  WHERE sn = 'testing' AND rt = 1 AND type = 'pump'
  ORDER BY id DESC
  LIMIT 1)
  
  UNION
  
  
  (SELECT *
  FROM table1
  WHERE sn = 'testing' AND rt = 2 AND type = 'pump'
  ORDER BY id DESC
  LIMIT 1)
  
  
  UNION
  
  (SELECT *
  FROM table1
  WHERE sn = 'testing' AND rt = 3 AND type = 'pump'
  ORDER BY id DESC
  LIMIT 1)
  </code></pre>
  <p>Currently i am trying the above.</p>
  <p>Which is the effective way to get the rows</p>