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

How to assign sql query results to pl sql variables?

1086


How do I send sql query results to excel?

1072


how to convert dates to character strings? : Sql dba

1178


How many sql core licenses do I need?

952


what is the difference difference between procedure and packages

10419


what is the use of friend function? : Sql dba

1024


Does normalization improve performance?

1044


Can primary key be changed?

913


what is union, minus and interact commands? : Sql dba

1190


what is query cache in mysql? : Sql dba

1042


Can dml statements be used in pl/sql?

1088


What are records give examples?

1014


How do I make my sql query run faster?

948


How do you delete duplicates in sql query using rowid?

950


What is the difference between join and natural join?

933