108020003 20601 20121019130214 108020003 20602 20121019130734 108020003 20603 20121019131157 108020003 20604 20121019131714 108020003 20605 20121019132137 108020003 20606 20121019141036 108020003 20607 20121019141451 108020003 20608 20121019141957 108020003 20609 20121019142735 108020003 20610 20121019144434 108020003 20611 20121019145003 108020003 20612 20121019145450 108020003 20613 20121019150619
108020003 20605 20121019132137 108020003 20606 20121019141036 108020003 20607 20121019141451 108020003 20608 20121019141957 108020003 20609 20121019142735
Select top 3 from table where id > @givenId order by id union select top 2 from table where id < @givenid order by id desc
Declare @givenId numeric(18,0) set @givenId=10802000320607 Select id from table where convert(numeric(18,0),left(id,14)) between @givenId-2 and @givenId+2 order by id
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)