Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Last row
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00415642
Message ID:
00419462
Vues:
27
>>Bottom in SQL Server terms is a relative term. SQL Server tables are physically ordered based on the a clustered index. If you have a clustered index on a date field, then the last row will be the highest date (assuming it is in ascending order), while the maximum PK may exist in the middle somewhere.
>>
>>Depending on the order you want you can use the TOP keyword in your SQL statement.
>>
>>select top 1 * from mytable order by mykey desc
>>
>>This will give the maximum and it won't involve two queries. My way of thinking would be you would first have to retrieve the maximum key and then query again based on that key. This is done in one step.
>>
>>HTH.
>
>Ahh, another strategy that seems workable.
>
>Thanks,

Big problem with TOP 1 on Fox tables. It goes through ALL the records to return you just the one you want. (Kind of an un-optimized search).
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform