id name 1 raj 2 sam 3 jhon 4 x 5 y 6 z 7 p 8 a
id name 3 jhon 4 x 5 y 6 z 7 p
Declare @id int; set @id =5; Select ID,name from My_Table where id between @id -2 and @id+2
select ID,Name from empdata where ID >= @ID-2 and ID <= @ID + 2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)