If you want to use a present index over bearing column, try thisDECLARE @Sample TABLE ( Location CHAR(1) NOT NULL, Bearing SMALLINT NOT NULL )INSERT @Sample ( Location, Bearing )VALUES ('A', 80), ('B', 125), ('C', 349), ('D', 233), ('E', 5)-- Solution by SwePesoDECLARE @Bearing SMALLINT = 340, @Deviation SMALLINT = 30IF @Bearing - @Deviation < 0 OR @Bearing + @Deviation >= 360 SELECT Location, Bearing FROM @Sample WHERE Bearing < (@Bearing + @Deviation) % 360 OR Bearing > @Bearing - @DeviationELSE SELECT Location, Bearing FROM @Sample WHERE Bearing > @Bearing - @Deviation AND Bearing < @Bearing + @DeviationBut what you really need, is to calculate a bounding box and for those location within the bounding box, apply a distance calculation and filter out those locations within the box but outside the circle.This is the fastest approach.
N 56°04'39.26"E 12°55'05.63"