Majid Maddah
Majid Maddah

Reputation: 57

select from row 5 To the end

how can i show the result from row 5 to the end ?

   select PersonID AS Field_Value , CONVERT  (varchar(8), PersonID)    + ' // ' + pfname +' '+ plname AS Display_Value
                     
       from [*].[*].[*]

thanx for help

Upvotes: 0

Views: 46

Answers (1)

Meyssam Toluie
Meyssam Toluie

Reputation: 1071

Using Common Table Expresion and Window Functions:

WITH CTE AS (
SELECT  PersonID AS Field_Value, 
        CONVERT(VARCHAR(8), PersonID) + ' // ' + pfname + ' ' + plname AS Display_Value,
        ROW_NUMBER() OVER( ORDER BY PersonID) RN
    FROM
        [*].[*].[*];
)
SELECT * FROM CTE WHERE RN > 5

Upvotes: 2

Related Questions