Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select top 2 returns more than 2
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01498480
Message ID:
01498482
Views:
62
Yes it's documented behavior of TOP clauase in VFP:

Rows with identical values for the columns specified in the ORDER BY clause are included in the query result. Therefore, a query result can contain more rows than specified with nExpr. For example, if you specify 10 for nExpr, the query result can contain more than 10 rows when more than 10 rows have identical values as specified with ORDER BY.



>oK.....Did some further testing.
>Seems if there are say 6 records with the same value, it returns all 6
>
>Gerard
>
>
>>I have following command:
>>SELECT TOP 2 REP FROM MyTable ORDER BY REP
>>
>>However this returns 6 records.
>>I was expecting just 2.
>>Tia
>>Gerard
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform