Query for getting Second Highest Number Record from a Table
Getting Second highest Marks from table
Two SQL commands will be used to get the second highest number from the table
First we will order the numbers in descending order by using Order By command so that we can get the highest number at the first position(first row) and second highest at the second position(second row) in the table.
Next we will use Limit command to display second highest number as Limit command is used to display some part of the records returned by a query specifying a range.
SQL Query:
SELECT *
FROM student
ORDER BY marks DESC
LIMIT 1,1;

0 comments:
Post a Comment