Skip to content
Advertisement

How to show 5 maximum value after joining two tables?

I have 2 tables:

  • users(uid, rollno, name)

users table

  • results(rid, uid, marks)

results table

So I want to show the highest 5 marks holder with their roll no and marks like-

I have tried:

but it is not showing the top 5 highest marks.

Advertisement

Answer

You need to get the top 5 marks from results and join to users:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement