Hi Sacraj,
I have created a schema and you could use the below query to get the records
create table sellowhigh(class int,ranks int)
insert into sellowhigh values(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,4),(3,1),(3,2),(3,3),(3,7),(4,2),(4,3),(4,5),(4,8)
select * from sellowhigh
select class,min(ranks)as ranks from sellowhigh group by class union
select class,max(ranks)as ranks from sellowhigh group by class
class Ranks
1 1
1 4
2 1
2 4
3 1
3 7
4 2
4 8
I hope this helps you a bit.
Regards,
RK