MYSQL实现上一条下一条功能

时间:2021-12-14 09:13:09

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