Returning a subset of rows using ROW_NUMBER() and Common Table Expression(CTE)

CGN007
Posted by CGN007 under Sql Server category on | Points: 40 | Views : 1469
WITH employeeCTE AS
(

SELECT ROW_NUMBER() OVER(ORDER BY emp_id DESC) AS Row,emp_id,emp_salary from employee
)
select * from employeeCTE where Row<5

Comments or Responses

Login to post response