Hi , this my table student how to find 2 rank of this table
can you write query for this table without total how to find rank
studId studName mark1 mark2 mark3
S001 Raja 60 70 40
S001 Siva 40 79 77
S001 Kumar 80 30 90
S001 Mani 60 70 40
----------------------------------
Sukesh MarlaPosted Sep 1, 2012, 6:04 AM
To get Top 2
select
To get second top
select
Checkthis is correct answwer if it helped
top 1 from (select top 2 studName from T order by (mark1+mark2+mark3) desc) TT order by (TT.mark1+TT.mark2+TT.mark3)top 2 studName from T order by (mark1+mark2+mark3) desc