当前位置:Gxlcms > PHP教程 > 如何取根据products_id为6取它的下一条记录

如何取根据products_id为6取它的下一条记录

时间:2021-07-01 10:21:17 帮助过:3人阅读

怎么取根据products_id为6取它的上一条记录。
怎么取根据products_id为6取它的上一条记录。
注意不能用products_id<6 limit 1条件,因为products_id是大小随机排列


------解决方案--------------------
select * from tt where products_id<6 order by products_id desc limit 1
------解决方案--------------------
select * from tt where price.products_id<6 and price.price='100' order by price.products_id desc limit 1 ,试试

人气教程排行