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 retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000

Answer Posted / dewesh

With cte as (
Select *, Dense_rank() over (order by salary desc) as s from emp)
Select EmpName, Salary from cte where s =2
It has work. But duplicate value is not removed if name is different

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Lookups are a key component in sql server integration services (ssis). Explain its purpose?

953


What is the process of debugging?

1000


What is the best partition size for windows 10?

946


What is pls_integer in pl sql?

1029


Are stored procedures compiled?

867


How to fetch alternate records from a table?

1157


How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

1034


How do I remove sql developer from windows 10?

1011


Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?

1111


What is the difference between delete and truncate commands?

971


How to revise and re-run the last sql command?

1098


Is subquery faster than join?

950


What is pl sql quora?

1070


Is sql open source?

914


Can we call a function containing dml statements in a select query?

916