mysql, oracle???????????????????
???????????? ???????[ 2017/1/19 15:34:37 ] ????????MySQL ?????
????1.Oracle:
????select * from ( select row_.*?? rownum rownum_ from ( query_SQL ) row_ where rownum == min
????2.SQL Server:
????select top @pagesize * from tablename where id not in (select top @pagesize*(@page-1) id from tablename order by id) order by id
????3.MySQL
????select * from tablename limit position?? counter
????4.DB2
????select * from (select *??rownumber() as ROW_NEXT from tablename) where ROW_NEXT between min and max
????——————————————————————————————–
????1.??????????(????Not In??SELECT TOP???)Ч????
????????????
????SELECT TOP 10 * FROM TestTable
????WHERE(ID NOT IN (SELECT TOP 20 id FROM TestTable ORDERBY id)) ORDERBYID
????SELECT TOP ???С * FROM TestTable
????WHERE( ID NOT IN (SELECT TOP ????С-1*????????-1 id FROM ?? ORDERBY id)) ORDERBYID
?????·:?????????????????????????id?????ID??????ЩID?е????????????
????2.???????????(????ID????????SELECT TOP???)Ч???
????????????
????SELECT TOP 10 * FROM TestTable
????WHERE(ID>(SELECT MAX(id) FROM(SELECT TOP20 id FROM TestTable ORDERBYid)AS T))ORDERBY ID
????SELECT TOP ???С* FROM TestTable
????WHERE(ID>(SELECT MAX(id) FROM(SELECT TOP ????С*????????-1 id FROM ?? ORDERBY id)AS T)) ORDERBY ID
?????·:????????????????????id???????????д??ID???????ID????????????????ID???????????
????3.???????????
????SELECT TOP PageSize * FROM(SELECT TOP nPage*PageSize * from YOURTABLE order by id)as a order by id desc
????SELECT TOP ?????? * FROM (SELECT TOP ??????*??????) * from YOURTABLE order by id)as a order by id desc
?????·:????????????????????(????????)????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11