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 many triggers can be applied on a table?

877


What does pragma mean?

969


Which are the different types of indexes in sql?

990


What are the operators in sql?

969


What is composite data type in pl sql?

1029


how to fetch common records from two tables? : Sql dba

1105


How do I save a sql query?

961


What are some predefined exceptions in pl/sql?

1057


What is lexical units in pl sql?

1043


Which software is used for pl sql programming?

928


What is implicit cursor in pl sql?

1024


What is the use of partition by in sql?

927


What is sql partition?

1035


What is relationship? How many types of relationship are there?

1068


what is data integrity? : Sql dba

985