hallo! would really appreciate your help here,
so i have created a table called "tblStudents" with studentId,Name and marks as the fields in it.
i have also created a query to rank the students according to there marks obtained. The query works fine with a Ranked output 1 2 3 4 5....etc BUT! when i try to filter with a certain criteria say.. >=50 (on the marks field)
i still get the same Rank results NOT based on the new filter.
What i want is: the query to rank based on the filter.
i use the following sub query.
SELECT T2.Student_ID, T2.Students, T2.Marks, (SELECT COUNT(T1.Marks)
FROM
AS T1
WHERE T1.Marks >= T2.Marks) AS Rank
FROM
AS T2
ORDER BY T2.Marks DESC;
so i have created a table called "tblStudents" with studentId,Name and marks as the fields in it.
i have also created a query to rank the students according to there marks obtained. The query works fine with a Ranked output 1 2 3 4 5....etc BUT! when i try to filter with a certain criteria say.. >=50 (on the marks field)
i still get the same Rank results NOT based on the new filter.
What i want is: the query to rank based on the filter.
i use the following sub query.
SELECT T2.Student_ID, T2.Students, T2.Marks, (SELECT COUNT(T1.Marks)
FROM
WHERE T1.Marks >= T2.Marks) AS Rank
FROM
ORDER BY T2.Marks DESC;