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...

Write a query to find second highest salary of an employee.

Answer Posted / gvmahesh

I write the query for this question using OLAP functions.

select e1.* from (select ename,sal,rank()
over(order by sal desc) rank from emp) e1
where e1.rank=2;

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of optimization?

932


Can we use ddl statements in stored procedure sql server?

989


Can we use the cursor's to create the collection in PL/SQL?

1006


What is the command used to fetch first 5 characters of the string?

1378


How do I turn a list into a table?

946


What is synonyms?

1040


Which join is default?

935


Why procedure is used in sql?

1025


what is 'mysqld'? : Sql dba

959


how to include comments in sql statements? : Sql dba

941


how can we know the number of days between two given dates using mysql? : Sql dba

1027


Can we create table in function?

945


what are all the common sql function? : Sql dba

1044


Can a key be both primary and foreign?

979


What are sql data types?

998