根据一定的排序规则 查询 前一名、当前用户及 后一名用户的信息
select * from (
select t1.*,
if(t1.userid=118,@k:=t1.id,null ) as results
from (
select e.*, (@i:=@i+1) as id from appuser_ext e ,(select @i:=0) as it ) t1 ,(select @j:=0,@k:=0) as it2 ) ttt3
where ttt3.id>=@k-2 and ttt3.id<=@k+2