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


Please Help Members By Posting Answers For Below Questions

What are the disadvantages of primary key and foreign key in SQL?

622


Explain few examples of stored procedure over triggers?

512


What purpose does the model database server?

650


What is the purpose of indexing?

594


What are three major types of constraints?

514






How do I find the sql server instance name?

527


What is the difference between createstatement and preparedstatement?

487


What is SQL Azure?

85


How many columns can we include on clustered index ?

507


What are trace flags?

586


Can you import Microsoft Excel data to SSRS?

89


What stored by the model? : sql server database administration

537


Why I am getting this error when renaming a database in ms sql server?

536


Mention the differences between substr and charindex in sql server.

509


What is parameterized reports in ssrs ?

105