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 union, minus and interact commands?

1300


How do I make sql search faster?

1001


What is a loop in sql?

989


What is faster join or subquery?

1013


What is data profiling in sql?

1084


Is sql pronounced sequel or sql?

1273


What is the function that is used to transfer a pl/sql table log to a database table?

1026


Explain the types of joins in sql?

1035


What are three advantages to using sql?

1024


How can you fetch common records from two tables?

1063


what is the difference between primary key and unique key? : Sql dba

1039


what are the 'mysql' command line options? : Sql dba

1076


Why stored procedures are faster than query?

1029


Define concurrency control. : Transact sql

1193


what is a stored procedure? : Sql dba

1137