The behaviour I want to replicate is like grep with -A and -B flags . eg grep -A 2 -B 2 \"hello\" myfile.txt will give me all the lines wh
-A
-B
grep -A 2 -B 2 \"hello\" myfile.txt
Try
Select * from theTable Where id >= (Select id - variableHere from theTable where message like '%hello%') Order by id Limit (variableHere * 2) + 1