简体   繁体   中英

fox pro query to return sequential row number

Is there any function like ROW_NUMBER() of sql server to return the sequential number of a row in visual fox pro?Actually i am using oledb command in c# to retrieve data from fox pro. I need something like row_number() function to select few rows at a time(like paging concept)

According to the MSDN Library , the ROW_NUMBER function returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition.

Visual FoxPro has a RECNO function that returns the current record number in the current or specified table. Review the MSDN Library for more information.

Caveat: recno() will not necessarily give a sequential number on a table. Deleted records remain in the table with a deleted() tag and will not go away until the table is packed. Until the table is packed, the record number will stay in use, even though you can't see the record while browsing the table.

From your SQL statement I think you need to specify which table you want the recno() to come from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM