Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Rank value on series

V prasadJun 9 2015 — edited Jun 9 2015


Hi

i would like to display result as below.

drop table test5;
create table test5(tno number);

begin
for i in 1..10 loop
  if i in (4,7,8) then
   null;
  else
    insert into test5 values(i);
  end if;
  end loop;
commit;
end;

select * from test5;

required result.

tno, rankVal
1     1
2     2
3     3
5     1
6     2
9     1
10    2

This post has been answered by SKP on Jun 9 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 7 2015
Added on Jun 9 2015
2 comments
145 views