A very important Sorting query that sort contents of a table according to two values. if values are equal based on first value then it sort contents according to second value. Here i have showed a query that sort contestants according to number of problem solved. If number of problem solved is equal then sort according to points.
Query :
SELECT sname, SUM(status) As Solved, SUM(point) As Points FROM submission Where cid='1' GROUP BY sname ORDER BY Solved DESC , Points DESC
0 comments:
Post a Comment