Skip to Main Content

SQL & PL/SQL

Query Help Please

Girish SharmaJun 21 2008 — edited Jun 22 2008

Hello,

Using : Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
        Windows XP Service Pack 1

Please help me to write a select query as below:

create table student(eno varchar2(10),rno varchar2(5),r0 number(5),r1 number(5),r2 number(5),r3 number(5));
insert into student values ('9352','A0000',0,0,0,0);
insert into student values ('15401','A0006',0,0,0,0);
insert into student values ('9478','A0000',0,0,0,0);
insert into student values ('6712','A0000',0,0,0,0);
insert into student values ('12410','A0006',0,0,0,0);
insert into student values ('9477','A0001',0,0,0,0);
commit;

Required output:

ENO        RNO           R0         R1         R2         R3
---------- ----- ---------- ---------- ---------- ----------
9352       A0000       6712       9478          0          0<--column output Should be asc order for column R0 to R3
15401      A0006      12410          0          0          0
9478       A0000       6712       9352          0          0
6712       A0000       9352       9478          0          0
12410      A0006      15401          0          0          0
9477       A0001          0          0          0          0

There will not more than 5 rows for a RNO. I am not getting any clue to get the output; so till now i have'nt write anything to get output.

Please guide me.

Thanks & Regards
Girish Sharma

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2008
Added on Jun 21 2008
12 comments
2,240 views