find 2nd highest salary of person using cursor concept?
Answer Posted / jcreddy
select e1.salary from employee e1
where 1 = (select count(salary) from employee e2 where
e1.salary < e2.salary)
order by marks asc
-- by changeing from '<', to '>' you will get min salary
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Explain transaction server explicit transaction?
How to configure and test odbc dsn settings?
What is the difference between system objects and user objects?
What are the rendering extensions of ssrs?
Does transparent data encryption provide encryption when transmitting data across the network?
What are different types of collation sensitivity?
What do you understand by physical_only option in dbcc checkdb?
what do you understand by change data capture?
How much does sql server 2016 cost?
Explain log shipping and mention its advantages.
How to run sql server 2005 books online on your local system?
Is a primary key unique?
Explain sub-query?
Why do we use trigger?
What is compression - row-level and page-level compression?