SQL Query to get first two highest column values from a table

前端 未结 1 1344
面向向阳花
面向向阳花 2021-01-14 17:16

I want to have a query in my sql which will return the result as -

I am having a table named employee with columns name,salary,address. The query should return the f

相关标签:
1条回答
  • 2021-01-14 18:11

    If the highest column is salary, you do this:

    select salary from employee
    order by salary desc
    limit 2
    

    You would do the same for any other columns, just replace the column name in the SELECT and in the ORDER BY sections.

    0 讨论(0)
提交回复
热议问题