Display top 5 marks in mysql without limits
Display top 5 marks in mysql without using limits.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj Kumar ChoudharyPosted Feb 10, 2016, 6:22 AM
(SELECT Employee .Salary, @curRank := @curRank + 1 AS rank FROM Employee , (SELECT @curRank := 0) r
Where Tab.rank<5
Murugappan MnPosted Feb 11, 2016, 11:54 PM
Murugappan MnPosted Feb 10, 2016, 11:11 PM
Rajeev PunhaniPosted Feb 10, 2016, 1:44 PM
Murugappan MnPosted Feb 10, 2016, 1:46 AM
Pankaj Kumar ChoudharyPosted Feb 10, 2016, 1:25 AM
(SELECT *, @curRank := @curRank + 1 AS rank FROM table_ p, (SELECT @curRank := 0) r)Tab
Where Tab.rank<5
Order BY Tab.col1
Murugappan MnPosted Feb 10, 2016, 12:36 AM
Rajeev PunhaniPosted Feb 9, 2016, 1:09 PM
If the above solution is helpful then,accept the answer.
Pankaj Kumar ChoudharyPosted Feb 9, 2016, 11:20 AM
(SELECT p.Marks, @curRank := @curRank + 1 AS rank FROM tTable-Name p, (SELECT @curRank := 0) r)Tab
Cassie ModPosted Feb 9, 2016, 10:31 AM