insert into table (item1, item2, name, subject)
select tt.item1 , rank() over(partition by tt.rr order by tt.tml_type_cd,tt.tml_id) as item2, tt.name , tt.subject from (select dense_rank() over(order by t.name ) as item1,t.name,t.subject from table1 t ) tt;
------解决方案--------------------