answersLogoWhite

0

How do you fetch second highest salary from table?

Updated: 8/18/2019
User Avatar

Wiki User

14y ago

Best Answer

select top 1 * from EMPLOYEE where SALARY < (select MAX SALARY FROM EMPLOYEE) ORDER BY SALARY DESC

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you fetch second highest salary from table?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How int find third highest salary in a table?

find third highest salary in a table


How do you find the fifth highest salary in a table?

Way To Get The Highest Salary From a TableTo Get nth Highest Salary From a Table:select ename, esal from emp order by esal desc limit (n-1),1;To Get 5th Highest Salary From a Table:select ename, esal from emp order by esal desc limit 4,1;


How do you fetch the data from already stored database by using php code?

Use the Select statement. As in &lt;?php // If you want all of the data $select = mysql_query("SELECT * FROM table_name"); // where table_name is name of your table // If you want selected data $select = mysql_query("SELECT id, username, password FROM table_name"); // If you want a particular data as in salary of employee named John from table employees $select = mysql_query("SELECT salary FROM employee WHERE Name='john'"); // Remember This only selects the data. Now the fetch part while($fetch = mysql_fetch_array($select)) { // replace the column_name with name of the column fields in database echo $fetch['column_name]; echo $fetch['column_name']; } ?&gt;


How do you find nth highest salary from table?

select *from emp e where n-1=(select count(distinct sal) from emp e where e.sal &gt;sal);


What is the highest size of a table tennis table?

The highest size of a table tennis table is 10.0cm i think, god knows.


Difference between cartesian product and full outer join?

Full outer join will fetch at maximum 'addition of 2 tables' Ex: Table A - 2 rows; Table B - 3 rows. Full outer join will fetch in 2+3 = 5 rows. Where as in Cartesian product will fetch in 'product of 2 tables'. Ex: Table A - 2 rows; Table B - 3 rows. Full outer join will fetch in 2x3 = 6 rows


What is the second step in making an income distribution table?

The second step in making an income distribution table is to rank individuals or households from lowest to highest income. This step helps organize the data and prepare for further analysis of income distribution in the population.


Where on the periodic table are elements which the highest atomic mass?

The elements with the highest mass are on the bottom right of the periodic table.


Which default value do the Job Code table and Location table have in common?

Salary Plan


What element in period 3 has the highest second ionization energy?

Fluorine because it is the furthest right on the periodic table. Do no include noble gases in energies.


Which element has got the highest ionisation potential in the periodic table?

Nitrogen has the highest first Ionization potential.


What is SA highest mountain?

the table