select name||decode(ROW_NUMBER() OVER (PARTITION BY name order  by name),1,null,ROW_NUMBER() OVER (PARTITION BY name order  by name)-1) from tab;

解决方案 »

  1.   

    还有一些其他的分析函数,楼主有时间可以去学习下
    http://blog.csdn.net/bw555/article/details/38037211
      

  2.   

    update table1 t
    set name=name||(select case when count(1)>0 then count(1) end from table1 where name=t.name and rowid<t.rowid);
      

  3.   

    试一下吧
    update tab A
    set name=(select  name from
          (select rowid recordid,name||decode(ROW_NUMBER() OVER (PARTITION BY name order  by name),1,null,ROW_NUMBER() OVER (PARTITION BY name order  by name)-1) as name from tab) 
       where recordid=a.rowid)
      

  4.   

    受4楼启发,还可以简略
    update table1 t
    set name=(select t.name||sum(1) from table1 where name=t.name and rowid<t.rowid);
      

  5.   

    只是为了取个唯一值来保证name后面的这个数字不会重复
    rowid是行的唯一标识,不会重复