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

When do we use triggers?

1081


Write a query to find the names of users that begin with "um" in sql?

997


What are inner and outer joins examples of both?

963


Explain the structure of pl/sql in brief.

1095


How do I write a cron which will run a sql query and mail the results to agroup?

981


What is update query?

984


Mention what plvcmt and plvrb does in pl/sql?

1143


What is anonymous block in sql?

1121


What does select * from mean in sql?

3240


Why do we use view in sql?

965


How can we store rows in PL/SQL using array?

1220


How you can copy a file to file content and file to pl/sql table in advance pl/sql?

1148


What are different types of sql commands?

1117


Why is sql better than hql?

993


Which is the correct statement about truncate and delete?

1112