I've got a table with 5 columns (student_id, class, sub_class, session, term, percentage). I want each student to be able to view their position according to their sub_class. i.e say there are 30 students in SSII sub_class A. It should show the position of each student with respect to their percentage score, if there happens to be a tie(i.e more than 1 students having the same scores), it should assign the same position to the affected students.
So far, the solution I've been able to get does not consider ties. I need to put into consideration the session, class and sub_class columns as the positions are based strictly on sub-classes. Plus I'd love to have an idea how to insert the SQL query into a PHP script.