GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Database  >  SQL

 Print  |  
Question:  Find second lowest salary from emp table

Answer: display the second lowest salary from emp table without using min & all


May 05, 2008 11:56:59 #2
 aleeza   Member Since: May 2008    Total Comments: 2 

RE: Find second lowest salary from emp table
 

select min(sal) from emp where sal=(select sal from emp where sal<>MIN(SAL) )            OR                                                                                                                                  select min(sal) from emp where sal=(select sal from emp having sal<>MIN(SAL) )                                                                                                                                                 May this will help you.I have not tested it in SQL and I am also not sure that the syntax is exactly right .may be you need to do same changes
 

     

 

Back To Question