title: Oracle Query to fetch right rows base on my
body: <p>I have sample date like below. I need to pick up the specific values (i.e) if column type values "st/cm" are similar to type column values "s/p" for columns id,name and value, then pick "s/p" rows as shown below</p>
  
  <pre><code>id   name  text  value  type   date type 
  123  tan   abc   98     st     2017-06-09  
  123  tan   abc   98     st     2017-06-09 
  123  tan   a     98     s      2017-06-09 --pick this
  123  tan   a     98     s      2017-06-09 --pick this
  124  pan   ndc   97     cm     2017-06-09  
  124  pan   ndc   97     cm     2017-06-09 
  124  pan   b     97     p      2017-06-09 --pick this
  124  pan   b     97     p      2017-06-09 --pick this
  </code></pre>
  
  <p>Expected Output:here the below columns are similar for type "ST/CM" compared to   "S/P" rows, so we pick "S/P" rows </p>
  
  <pre><code>    id   name  value  type   date type 
      123  tan    98     st     2017-06-09  
      123  tan    98     st     2017-06-09 
      123  tan    98     s      2017-06-09 --pick this
      123  tan    98     s      2017-06-09 --pick this
      124  pan    97     cm     2017-06-09  
      124  pan    97     cm     2017-06-09 
      124  pan    97     p      2017-06-09 --pick this
      124  pan    97     p      2017-06-09 --pick this
  </code></pre>