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

posted @ 2021-01-08 19:14  hanby  阅读(481)  评论(0)    收藏  举报
//看板娘