how to find the second salary?

Answer Posted / moorthy t

select n,* from(select rownum n,* from (select * from table
where group by (sal) order by (sal) desc)) where n=2;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give me a SQL Query to find out the second largest company?

686


What are rows and columns?

511


Difference between primary key and clustered index?

500


How do I find the sql server version?

512


You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?

88






What is plan freezing?

578


When does a workload on SQL Azure get throttled?

113


If any stored procedure is encrypted, then can we see its definition in activity monitor?

543


How to find related tables in sql server?

493


What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?

739


What is a constant or literal in ms sql server?

587


What is format parameter in ssrs?

109


Define master database?

573


What is the difference between substr and charindex in the sql server?

498


What is the difference between composite index and covering index?

503