深度分頁,我都是這么玩的
點擊上方藍字“設為星標”
?
select * from table where id < #{lastId} order by id desc limit #{limit}?
?
4 2022-01-01 12:12:12.1114313 2022-01-01 12:12:12.1114312 2022-01-01 12:12:10.1114311 2022-01-01 12:12:09.111431
?
我們的SQL如下:
?
select * from table order by time desc limit 1?
select * from table where time < '2022-01-01 12:12:12.111431' order by time desc limit 1?
?
select * from table where time < '2022-01-01 12:12:12.111431' or (time='2022-01-01 12:12:12.111431' and id < 4) order by time desc,id desc limit 1?
?
大家好,我是從古代穿越過來的美男子:架構擺渡人。我將把我的武功秘籍全部傳授與你們,覺得有用請分享給身邊的朋友。來個三連吧,感謝各位!另外我還在B站錄制了《真實訂單業(yè)務,億級數(shù)據(jù)帶你實戰(zhàn)分庫分表》的實戰(zhàn)課程,記得去學習哦!
評論
圖片
表情
