मुझे लगता है कि आप कुछ इस तरह इस्तेमाल कर सकते हैं:
SELECT *
FROM videos AS c
WHERE (VideoId = (SELECT MAX(VideoId) FROM videos WHERE VideoId < c.VideoId AND IsActive = 1)
OR VideoId = (SELECT MIN(VideoId) FROM videos WHERE VideoId > c.VideoId AND IsActive = 1))