MYSQL实现上一条下一条功能

select id from
(
select *, (@i:=@i+1) as rownum from pre_bet_zhibo,(select @i:=0) as it
where link_conent like '%足%'
order by title
) as t1 where rownum =
(
select rownum from
(
select *, (@i:=@i+1) as rownum from pre_bet_zhibo,(select @i:=0) as it
where link_conent like '%足%'
order by title
) as t1
where id = 186
) + 1;

select *, (@i:=@i+1) as rownum from pre_bet_zhibo,(select @i:=0) as it
where link_conent like '%足%'
order by title

原文地址:https://www.cnblogs.com/yufan27209/p/5785222.html