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 / karunakarreddy.boyapally

SELECT DISTINCT A.SAL FROM EMP A
WHERE &N=(SELECT COUNT(DISTINCT(B.SAL)) FROM EMP B
WHERE A.SAL<B.SAL)

IF SUPPOSE IF U WANT 1 HIGEST SALARY GIVE N=1
IF SUPPOSE IF U WANT 2 HIGEST SALARY GIVE N=2
IF SUPPOSE IF U WANT 3 HIGEST SALARY GIVE N=3

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

is mysql query is case sensitive? : Sql dba

1099


What is pivot in sql?

909


What do you understand by pl/sql packages?

1058


Why do we use function in pl sql?

1058


What are conditional predicates?

1056


what is sp_pkeys? : Transact sql

1149


Can we use having without group by in sql?

982


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

1034


What is clustered index in sql?

1050


How do I run a script in sql developer?

944


How to return an array from java to pl/sql?

1131


Can delete statement be rollbacked?

984


Are there any features that are decommissioned in 11g that are not present in 11g?

2140


When is the explicit cursor used ?

1030


what is try_catch block in procedure

1738