find 2nd highest salary of person using cursor concept?
Answer Posted / pawan
select * from emp a where 2=(select count(distinct(sal)) from emp b where a.sal<=b.sal);
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do you run a trace?
What are the different Authentication modes in SQL Server and how can you change authentication mode?
Can a stored procedure call itself or a recursive stored procedure? How many levels of sp nesting is possible?
In what version of sql server were synonyms released?
What is abstracting periodical?
What is the maximum size per database for sql server express?
Why variables called the most powerful component of ssis?
What are the different types of locks in the database?
What is a user-defined function in the sql server and what is its advantage?
What are the restrictions while creating batches in sql server?
What is the difference between delete and truncate statements?
Do you know what are acid properties of transaction?
Write a SQL query in order to merge two different columns into single column?
Can we write ddl in trigger?
Detail about the hardware which is supported by SQL server?