Follow us on Social Media:

MySQL Database Administrator

Boost Your Quick Knowledge in MySQL DBA Work, Concepts, Tips and Trick

Thursday, 19 April 2018

Select Query to Print Rank on belalf of obtained Marks

​We have a test table as below..

Run below query to print rank...

SELECT id,  marks,
find_in_set(marks,(SELECT GROUP_CONCAT( distinct(marks) ORDER BY marks DESC ) FROM test )) AS rank
FROM test.test;

No comments:

Please Like and Subscribe us ....

Please visit the website on daily basis , Your New articles will publish at any moment. Please Subscribe us for getting Latest Updates...