/**/比如 ID = 50
上一条 and 下一条 */
select top 1 p_title from t_photo where p_id<50 order by p_id desc
select top 1 p_title from t_photo where p_id>50 order by p_id asc
SQL中查询指定数据的 上一条或下一条数据
最新推荐文章于 2023-08-01 14:54:48 发布
/**/比如 ID = 50
上一条 and 下一条 */
select top 1 p_title from t_photo where p_id<50 order by p_id desc
select top 1 p_title from t_photo where p_id>50 order by p_id asc