Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumSoftware Testing @ OneStopTestingBeginners @ OneStopTesting

Message Icon Topic: SQL Query to get second highest salary-FAQ

Post Reply Post New Topic
Author Message
snigdha_123
Newbie
Newbie
Avatar

Joined: 17Dec2007
Location: India
Online Status: Offline
Posts: 40
Quote snigdha_123 Replybullet Topic: SQL Query to get second highest salary-FAQ
    Posted: 30Jan2009 at 12:00pm
SQL Query to get second highest salary-Frequently Asked Question in interviews
 
 
 



Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
nidhinav
Newbie
Newbie


Joined: 05Feb2009
Online Status: Offline
Posts: 1
Quote nidhinav Replybullet Posted: 05Feb2009 at 2:44am
Select salary from salary ORDER BY salary DESC LIMIT 1,1
IP IP Logged
skumar75.qa
Newbie
Newbie


Joined: 18Sep2009
Online Status: Offline
Posts: 16
Quote skumar75.qa Replybullet Posted: 21Sep2009 at 12:51am

Query for second highest Salary:

select max(salary) from Employee where salary >(select max(Salary) from employee;
 
IP IP Logged
skumar75.qa
Newbie
Newbie


Joined: 18Sep2009
Online Status: Offline
Posts: 16
Quote skumar75.qa Replybullet Posted: 21Sep2009 at 12:52am

Query for second highest Salary:

select max(salary) from Employee where salary < (select max(Salary) from employee order by salary
 


Edited by skumar75.qa - 30Sep2009 at 1:38am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.188 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting