title: (Oracle)Getting 25th number using interpolating
body: <p>My goal is to get 25th number. For instance I have 4 row, such as 3,4,5 and 7.
  My goal is to get 1.25th(=(4+1)<em>0.25).
  Expected result is 3.25 which is obtained by interpolating(3+0.25</em>(4-3)).</p>
  <p>I have tried as below.
  But is there any other efficient way?</p>
  <pre><code>WITH DATASET AS (
  SELECT 3 C1 FROM DUAL
  UNION 
  SELECT 4  FROM DUAL
  UNION 
  SELECT 5  FROM DUAL
  UNION 
  SELECT 7  FROM DUAL
  )
  SELECT 
  --RNK, C1, NEXTC1-C1, FIRSTQLOCAION, FIRSTQLOCAION-RNK, C1+(NEXTC1-C1)*(FIRSTQLOCAION-RNK)
  C1+(NEXTC1-C1)*(FIRSTQLOCAION-RNK)
  FROM( 
  SELECT C1, 
  LEAD(C1, 1) OVER (ORDER BY C1) as NEXTC1 ,
  RANK() OVER (ORDER BY C1) AS RNK,
  ((SUM(1) OVER (PARTITION BY NULL)) +1) * 0.25 AS FIRSTQLOCAION
  FROM DATASET
  )
  WHERE
  FIRSTQLOCAION&gt;=RNK AND FIRSTQLOCAION&lt;=RNK+1;
  </code></pre>