what is syntex second or third highest salary.


thanks & Regards
Dhirendra sinha

Answer Posted / veeresh kethari

with Topsal (EmpID,Ename,Sal,Dno,Topsal) as
(select *,row_number() over(order by sal) Topsal from emp)
select top 2 EmpID,Ename,Sal,Dno from Topsal order by sal desc

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain filestream storage of sql server 2008?

694


Explain isolation levels that sql server supports?

762


List layers of abstraction microsoft architectured to provide relational db through cloud platform ?

175


What is SQL Azure Data sync?

115


What is inline variable assignment?

783






What are trace files?

707


What are the difference between data mart and data warehouse? : sql server analysis services, ssas

706


When we should use @@error?

705


What is difference between group by and having?

720


What do you understand by intent locks?

745


Can you please explain the difference between primary keys and foreign keys?

839


List some of the rules that apply to creating and using a ‘view’

673


What stored by the model? : sql server database administration

710


What is an indexed view?

745


How to create view in stored procedure sql server?

691