Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
... and then I fell off my chair.
Message
De
04/10/2001 05:00:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/10/2001 03:04:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00563467
Message ID:
00563998
Vues:
17
Pascal,
Would you try this, it might recover performance (it worked) :

select top 1 myfield from mytable order by 1 desc && Descending provides max

PS: This might return multiple rows when there are many with same max value. But IMHO not a big deal :
external array arrMaxDate
select top 1 order_date from orders ;
 order by 1 desc ;
 into array arrMaxDate
ldMaxDate = iif(type('arrMaxDate')='D',arrMaxDate,{}) && or _Tally checking
Cetin

>Cetin,
>
>Thanks for testing.
>I had already got to the workaround you suggest but indeed performance did drop as the table doesn't have an index on deleted.
>
>Pascal.
>
>>Pascal,
>>YOU'RE RIGHT !!! I could reproduce it if field was of date or datetime datatype.
>>It doesn't behave that way in VFP6 or 7.
>>I'm afraid you should use old workaround :
>>
>>select ... from ... where !deleted() and ...
>>
>>This might make sense to have an index on deleted().
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform