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 get second highest salary in SQL(as/4000

Answer Posted / selvaspak

select sal from (select sal,rank() over(order by sal desc)
as rank from emp) where rank = &no

Actually for this Question there are having lot of method
to get the result, but the interviewer is asking this for
to check whether the interview person know the RANK()
function or not. So the above query is correct

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cursor and its types?

1026


What is not null in sql?

1007


What are the advantages of pl sql?

1092


What is number function in sql?

934


How do you explain an index?

1243


How global cursor can be declare with dynamic trigger ?

2165


Does mysql_real_escape_string prevent sql injection?

925


Explain commit, rollback and savepoint.

958


what is auto increment? : Sql dba

980


Name the operator which is used in the query for pattern matching?

916


What is the sql case statement?

974


What will you get by the cursor attribute sql%found?

936


Explain ddl statements in pl/sql?

979


What does pl sql developer do?

901


What is tuple in sql?

1029