title: Group up over consecutive records, save for the last character
body: <p>Suppose I have a table, which looks like the following:</p>
  
  <pre><code>InventoryVAS     colVAS     IP
  
  fvas1               5       172.21.4.97
  fvas2               6       172.21.4.97
  abcd                4       10.4.6.89
  ef1                 7       169.21.5.67
  ef2                 8       169.21.5.67
  </code></pre>
  
  <p>Whenever there are 2 same consecutive <code>IP</code>s, the <code>InventoryVAS</code> columns will always have same value except for last character.</p>
  
  <p>e.g. fvas in fvas1 and fvas2 for 172.21.4.97 </p>
  
  <p>I need my final table to be like this:</p>
  
  <pre><code>InventoryVAS     colVAS     IP
  
  fvas                5/6     172.21.4.97
  abcd                4       10.4.6.89
  ef                  7/8     169.21.5.67
  </code></pre>
  
  <p>In real scenario, my table has 100s of records which have same <code>IP</code>s and <code>InventoryVAS</code> value same for that <code>IP</code> except the last character. I need to exclude this last character so as to make it a single row with middle column (colVAS) value = (value in  row1)/(value in row2).</p>
  
  <hr>
  
  <p>I've tried Gordon's answer and got the following:</p>
  
  <pre><code>create table VAS(
  InventoryVAS varchar2(40),
  colVAS       number,
  IP           varchar2(40)
  )
  
  insert into VASInventory values ('fvas1',5,172.21.4.97);
  insert into VASInventory values ('fvas2',6,172.21.4.97);
  insert into VASInventory values ('abcd',4,10.4.6.89);
  insert into VASInventory values ('ef1',7,169.21.5.67);
  insert into VASInventory values ('ef2',8,169.21.5.67);
  select * from VAS;
  
  select substr(InventoryVas, length(InventoryVas) - 1) as InventoryVas,
         (case when min(colvas) &lt;&gt; max(colvas) then min(colVas)||'/'||max(colVas)
               else min(colvas)
          end) as colVas,
         ip
  from VAS
  group by substr(InventoryVas, length(InventoryVas) - 1), ip;
  ---------------------------------------------------------------------------
  ERROR :
  ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
  00932. 00000 -  "inconsistent datatypes: expected %s got %s"
  *Cause:    
  *Action:
  Error at Line: 24 Column: 19
  </code></pre>
  
  <hr>
  
  <pre><code>create table VAS(
  InventoryVAS varchar2(40),
  colVAS       number,
  IP           varchar2(40)
  )
  drop table VAS;
  insert into VASInventory values ('fvas1',5,172.21.4.97);
  insert into VASInventory values ('fvas2',6,172.21.4.97);
  insert into VASInventory values ('abcd',4,10.4.6.89);
  insert into VASInventory values ('ef1',7,169.21.5.67);
  insert into VASInventory values ('ef2',8,169.21.5.67);
  select * from VAS;
  
  select substr(InventoryVas, length(InventoryVas) - 1) as InventoryVas,
         (case when min(colvas) &lt;&gt; max(colvas) then min(colVas)||'/'||max(colVas)
               else min(colvas)
          end) as colVas,
         ip
  from VAS
  group by substr(InventoryVas, length(InventoryVas) - 1), ip;
  ---------------------------------------------------------------------------
  ERROR :
  ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
  00932. 00000 -  "inconsistent datatypes: expected %s got %s"
  *Cause:    
  *Action:
  Error at Line: 24 Column: 19
  </code></pre>