How to find 3rd highest salary of an employee from the employee table in sql?
Answer / Mohammad Badizzamaan
To find the third highest salary, you can use a subquery with the DISTINCT keyword and ORDER BY clause along with LIMIT and OFFSET clauses. Here is an example SQL query:n`nSELECT salaries FROM ( SELECT DISTINCT salaries FROM employee ORDER BY salaries DESC LIMIT 3 OFFSET 1 ) as temp;nThis will return the third highest salary from the employee table.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to return multiple rows from the stored procedure?
Why is there a need for sqlcode and sqlerrm variables?
Is sql sequential or random?
What is the source code of a program?
What is sql in oracle?
What does dml mean?
Difference between IN and EXISTS
what are dynamic queries in t-sql? : Transact sql
Can we rename a column in the output of sql query?
What is a dirty read sql?
What does partition by mean in sql?
What is the need of a partition key?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)