title: Find the greatest version
body: <p>I am using Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 </p>
  
  <p>I have a table as follows:</p>
  
  <pre><code>Table1:
  Name              Null     Type          
  ----------------- -------- ------------- 
  NAME              NOT NULL VARCHAR2(64)  
  VERSION           NOT NULL VARCHAR2(64) 
  
  
  Table1
  Name    Version
  ---------------
  A         1
  B         12.1.0.2
  B         8.2.1.2
  B         12.0.0
  C         11.1.2
  C         11.01.05
  </code></pre>
  
  <p>I want the output as:</p>
  
  <pre><code>Name    Version
  ---------------
  A        1
  B        12.1.0.2
  C        11.01.05
  </code></pre>
  
  <p>Basically, I want to get the row for each name which have highest version. For this I am using the following query:</p>
  
  <pre><code>SELECT t1.NAME, 
         t1.VERSION
  FROM TABLE1 t1 
  LEFT OUTER JOIN TABLE1 t2
  on (t1.NAME = t2.NAME and t1.VERSION &lt; t2.VERSION)
  where t2.NAME is null
  </code></pre>
  
  <p>Now 't1.VERSION &lt; t2.VERSION' only works in normal version cases but in cases such as:</p>
  
  <pre><code>B         12.1.0.2
  B         8.2.1.2
  </code></pre>
  
  <p>It fails, I need a PL/SQL script to normalize the version strings and compare them for higher value.</p>