Data query, only with the database paging, can alleviate the data too large on the impact of the program, to avoid the appearance of memory overflow.
The following field descriptions for the various databases:
1. Table historypacking, including field Cardnumber flag ...
2. Table pickaddress, including field pickaddressid ...
1.SQL Server 2005 (2000 is not supported, support for more than 2005 versions):
SELECT * FROM (SELECT *, Row_number () Up (Order by a.time DESC) as RowNumber
From historypacking as a where a.cardnumber= ' 512000005935 ' and a.flag=0 ) as B where RowNumber between 1 and 5; (Start number and end number)
2.Oracle Database Paging
SELECT *
From (select RowNum as Num,a.* from (SELECT * from pickaddress order by Pickaddressid ASC) a) t
where T.num>=6 and t.num<=11; (sorted by Pickaddressid, result set between 6 and 11 bits, included)
For data that needs to change according to the table of the query!
3.MySQL Database paging
SELECT * from table limit m,n;
where m refers to the beginning of the record index, starting from 0, indicating the first record
n means starting from section m+1 and taking N. (N to be fixed)
This article is from "Yong Xin Technology Blog" blog, please be sure to keep this source http://rusth2015.blog.51cto.com/9973392/1618567
Database paging query for various databases