SELECT MAX(Score)
FROM Students
WHERE Score < (SELECT MAX(Score) FROM Students);
the above query works perfectly and fetches the record that has 2nd highest score, whereas the query mentioned below does not fetch anything
SELECT *
FROM Students
WHERE Score < (SELECT MAX(Score) FROM Students);
here Students is the table from which I want to fetch all the details of that record which has 2nd highest score in the entire table.
I want that 2nd query should get executed, thanks in advance for helping me out.
- I have not used any database, I'm simply trying out these queries in w3schools.