Goodmorning, I’m doing a query to fill a MFC Recordset in my program. Since the moment that I have a lot of rows in that table, I would load only a certain number of records at time.
Is that possible? How?
Goodmorning, I’m doing a query to fill a MFC Recordset in my program. Since
Share
You require
LIMITclause in yourselectstatement to get records in a range.Notes from Select statement syntax:
The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants, with these exceptions:
? placeholder markers.
integer-valued routine parameters or local variables.
With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1):
To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:
With one argument, the value specifies the number of rows to return from the beginning of the result set:
In other words,
LIMIT row_countis equivalent toLIMIT 0, row_count.