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 are the advantages of using stored procedures? : Sql dba

1157


what is offset-fetch filter in tsql? : Transact sql

1000


How can you create an empty table from an existing table?

1129


Can we join tables without foreign key?

1008


what is normalization? : Sql dba

1137


what is a trigger in mysql? Define different types of trigger. : Sql dba

1121


Is clustered index a primary key?

990


What is user in sql?

1078


how to drop an existing index in mysql? : Sql dba

1114


Can you have more than one trigger on a table?

1047


What is use of term?

1128


What are sql queries used for?

1079


Is a table valued function object?

1076


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2553


What is duration in sql profiler trace?

1140