Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compare two SQL Select
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01508173
Message ID:
01508211
Views:
34
>Thank you. You experience and logic pretty much confirms for me that using the query without TOP and then simply GO TOP on the resulting query (created without TOP 1) will not adversely affect the time.

Are you using SQL Server or VFP? You can also try

select T.* from myTable T inner join (select top 1 PK from myTable ... ORDER ...) X ON T.PK = X.PK

This may perform better.

---------------------
Also, if we're talking SQL Server, then, of course, if you only need 1 record, you select just one records.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform