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

What is pl sql code?

1004


what is the command used to fetch first 5 characters of the string? : Sql dba

1604


What are data types in pl sql?

1095


Can you call pl/sql package functions from within a fast formula?

990


How do you update a table in sql?

944


what is a database? : Sql dba

1115


what is a trigger in mysql? Define different types of trigger. : Sql dba

1028


What is tuple in sql?

1022


What are the possible values for the boolean data field?

916


What are the two parts of design view?

985


How do I run a program in pl sql?

970


Can we create a trigger on view?

855


What are database links used for?

1010


Does truncate remove indexes?

985


explain the difference between bool, tinyint and bit. : Sql dba

951