Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find the second highest salary from emp table?

Answer Posted / hridayeshwar rao

select max(age) from yd where age<(select max(age) from HK) ; /// True two table Highest

SELECT * FROM HK E1 WHERE 1 =(SELECT COUNT(DISTINCT age) FROM HK E2 WHERE E1.age < E2.age); ///Second Hightest age RT single table

select age from hk e1 where (3-1) = (select count(distinct (e2.age)) from yd e2 where e2.age>e1.age);//// same True Second Hight age RT two table

select max(age) from YD where age not in (select max(age) from YD); //second hight age in single table

Suppose that salery=age

Thanks !!!

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pl sql script?

979


Why do we need pl sql?

937


What is an exception in pl/sql?

1009


Why do we create stored procedures & functions in pl/sql and how are they different?

889


Is sql procedural language?

921


What is a trigger in sql?

1158


What is pl sql block in dbms?

952


What is not equal in sql?

1012


What does select top 1 do in sql?

1007


Is like operator in sql case sensitive?

962


What are system versioned tables?

969


When sql appeared?

1025


Cite the differences between execution of triggers and stored procedures?

1031


How does postgresql compare to "nosql"?

983


List different type of expressions with the example.

896