

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can we fetch a second highest salary of an employee from a MySQL table?
To understand this concept, we are using the data from table ‘Salary’ as follows −
mysql> Select * from Salary; +--------+--------+ | Name | Salary | +--------+--------+ | Gaurav | 50000 | | Rahul | 40000 | | Ram | 45000 | | Raman | 45000 | +--------+--------+ 4 rows in set (0.00 sec) mysql> Select * from salary12345 order by salary DESC limit 1 offset 1; +-------+--------+ | name | Salary | +-------+--------+ | Raman | 45000 | +-------+--------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- Find max and second max salary for a MySQL Employee table?
- Find max and second max salary for a MySQL Employee table using subquery?
- How can we fetch a particular row as output from a MySQL table?
- How can we fetch all the records from a particular MySQL table?
- How can we fetch alternate even-numbered records from MySQL table?
- How can we fetch alternate odd numbered records from MySQL table?
- How can we fetch one or more columns as output from a MySQL table?
- Select highest salary in MySQL?
- How can we remove a column from MySQL table?
- How can we create a table from an existing MySQL table in the database?
- Can we select second largest record from a table without using LIMIT clause in MySQL?
- How can we delete a single row from a MySQL table?
- MySQL edit and update records including employee salary
- How can we drop UNIQUE constraint from a MySQL table?
- How can we delete multiple rows from a MySQL table?
Advertisements