title: Get only best ranked rows from a subquery
body: <p>I want to get the price of an article for a specific customer.<br>
  There are several levels of prices which i ranked in my query.<br>
  So Article A has a price on rank 1, 4, 6. The result should always be the lowest ranked price.</p>
  
  <pre><code>Article B rank 3 ,5 
  </code></pre>
  
  <p>So article A price is ranked 1 and Article b is price ranked 3.
  My query is below . </p>
  
  <pre><code>SELECT p2.* FROM(
  SElect ART_ID, MIN(RANG) RANG FROM (
  Select p.ART_ID, p.betrag ,
  CASE p.PREIS_EBENE WHEN 'KA' THEN 1 WHEN 'KW' THEN 2 WHEN 'W' THEN 7 WHEN 'A' THEN 6 ELSE 99 END RANG
  FROM MDART a
  INNER JOIN MDPRSVK p ON (a.KLIENT_ID = p.KLIENT_ID AND a.ART_ID = p.ART_ID)
  WHERE ICP_KZ.IS_SET(KENNUNG_USER, 'P') = 1
  ORDER BY RANG)
  GROUP BY ART_ID) T
  
  INNER JOIN MDPRSVK p2 ON (p2.ART_ID = T.ART_ID AND p2.PREIS_EBENE = p.PREIS_EBENE)
  </code></pre>
  
  <p>i want to have every article appearing only once in the result</p>