title: How to Split a comma separated string in Oracle
body: <p>How to Split a comma separated string in Oracle using <code>SUBSTR</code> and <code>INSTR</code>.</p>
  
  <p><strong>String '20.4,12.5,3.5,0.2,0.2'</strong>.</p>
  
  <p>I tried using the below code, but I'm unable get the value after the 2nd comma.</p>
  
  <pre><code>SELECT substr('20.4,12.5,3.5,0.2,0.2',0,instr('20.4,12.5,3.5,0.2,0.2',',')-1) 
  value FROM dual   -- 1. 20.4
  </code></pre>
  
  <p>for second value i'm getting the entire string after 2nd comma.</p>
  
  <pre><code>SELECT substr('20.4,12.5,3.5,0.2,0.2',instr('20.4,12.5,3.5,0.2,0.2',',')+1,instr('20.4,
  12.5,3.5,0.2,0.2',',',2,2)-1) st FROM dual   -- result : 12.5,3.5,
  </code></pre>
  
  <p>I want the value after each comma, like </p>
  
  <p>20.4</p>
  
  <p>12.5</p>
  
  <p>3.5 and so on.</p>