dear i am using the following query which works some time fine but when student got same position it is skip the sma e position to second one. please view the attached query;
SELECT t.*, rownum FROM
(select perc,dense_rank() over (partition by class,SECtion,examc order by perc DESC NULLS LAST) AS pos,class,section,examc,stuid,name
from (select round((sum(obtmarks)/sum(totmarks)*100)) As perc,student.class,test.examc,
test.section,student.stuid,student.name
from test,test1,class,TsubJ,student
where test.tid=test1.tid
and test.tdate=test1.tdate
and test.class=:cls
and test.section=:ssec
and test1.tstuid=student.stuid
and student.STATUS='PRESENT'
and tsubj.Tsubj=test.subject
and tsubj.cname=class.cname
and examc=:ty
group by student.class,examc,test.section,STUID,name)) t
WHERE ROWNUM <=4
please view the attached file.