Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last 10 records based on a condition
Message
From
31/12/2001 17:48:17
 
 
To
31/12/2001 17:43:25
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00599284
Message ID:
00599522
Views:
45
>>>>>No, with order by clause it will have to create result set first, order it and than pick TOP N records from it. The same way it works in VFP.
>>>>
>>>>Well, as my result is the first most recent, thus the last 10 in the table which matches the condition, it means that no matter if that would be in Visual FoxPro or in SQL Server, it'll take some time.
>>>
>>>Correct.
>>
>>Ok, thanks for the clarification. I ended up not to do that option finally. :)
>
>A slight workaround - if you had a timestamp field, you could use the TOP 10 on that field, plus a Wherre clause, assuming it's a real timestamp, so the last 10 records would have the 10 latest datetimes.

We have something similar. Our prime tag is the primary key. But, even with an order on that field, it still has to work on the entire table first.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform