title: Rank of a Group by Function
body: <p>I have 3 tables 
  SELECT * FROM BIS_RCNC_CRIT_ATTR </p>
  
  <pre><code>RCNC_CRIT_ATTR_ID   RCNC_CRIT_SET_ID    RCNC_ATTR_TYP_ID    RCNC_CRIT_ATTR_EXPR
  60947   10660   5   5322
  61039   10706   5   5322
  75241   13077   5   5322
  </code></pre>
  
  <p>SELECT * FROM BIS_RCNC_ATTR_TYP</p>
  
  <pre><code>RCNC_ATTR_TYP_ID    RCNC_TYP_ID RCNC_ATTR_TYP_NM    RCNC_ATTR_TYP_DSC
  1   1   SN  SN
  2   1   CU  CU
  3   1   IS  IS
  4   1   SE  SE
  5   1   IV  IV
  6   1   BE  BE
  7   1   PN  PN
  8   1   PV  PV
  </code></pre>
  
  <p>SELECT * FROM BIS_RCNC_CRIT_SET</p>
  
  <pre><code>RCNC_CRIT_SET_ID    RCNC_CRIT_TYP_ID    RCNC_CRIT_SET_STAT
  10660   2   A
  10706   2   A
  13077   2   A
  </code></pre>
  
  <p>I am running a query</p>
  
  <pre><code>select
      BIS_RCNC_CRIT_SET.RCNC_CRIT_SET_ID AS "ID",
      max(case when rcnc_attr_typ_nm ='IV' then rcnc_crit_attr_expr else null end) as "ACCT",
      max(case when rcnc_attr_typ_nm ='PN' then rcnc_crit_attr_expr else null end) as "Platform"
      FROM BIS_RCNC_CRIT_SET
  INNER JOIN BIS_RCNC_CRIT_ATTR
      ON BIS_RCNC_CRIT_SET.RCNC_CRIT_SET_ID = BIS_RCNC_CRIT_ATTR.RCNC_CRIT_SET_ID
  INNER JOIN BIS_RCNC_ATTR_TYP
      on bis_rcnc_crit_attr.rcnc_attr_typ_id = bis_rcnc_attr_typ.rcnc_attr_typ_id
  where bis_rcnc_crit_set.rcnc_crit_typ_id = 2 and bis_rcnc_crit_set.RCNC_CRIT_SET_STAT = 'A'
  group by
  BIS_RCNC_CRIT_SET.RCNC_CRIT_SET_ID
  </code></pre>
  
  <p>The query is fetching duplicate value for IVAN and platform.</p>
  
  <pre><code>10706   5322        Bloomberg
  10660   5322        Bloomberg
  13077   5322        Bond Desk
  </code></pre>
  
  <p>How to eliminate duplicates based on platform and IVAN</p>
  
  <p>What I want </p>
  
  <pre><code>10706   5322    Bloomberg   
  13077   5322    Bond Desk
  </code></pre>