SELECT * from ( SELECT @rownum := @rownum+1 as ronum, CASE a.id WHEN '9' THEN @currentrow := @rownum ELSE '0' END as 'current_row', a.* FROM tz_content_article a, (SELECT @currentrow:= 0) c, (SELECT @rownum := 0) r WHERE a.obj_type = 'baike' and a.status=1 ORDER BY a.seq desc, a.`update_time` DESC ) as article_with_row where ronum > @currentrow - 2 limit 3
数据库查询,mysql排序,mysql上一篇,mysql下一篇
多字段排序查询上一篇下一篇