Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select max(fkey) from table into array lavalue
Message
 
À
31/01/2006 03:24:50
Ken Knorr
Logos Management Software
Ventura, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01091785
Message ID:
01091791
Vues:
13
Ken,
I asked that question before and Sergey points me to HELP. Unfortunately I coudn't find the thread so check SET ENGINEBEHAVIOR in HELP especialy the section 90 and GROUP BY. It says:

GROUP BY
When using aggregate functions, such as MAX( ), in the SQL SELECT command without a GROUP BY clause, and no matching records are found, Visual FoxPro returns a result set with a single record and _TALLY set to 1. In versions prior to Visual FoxPro 9.0, no records are returned, and _TALLY is set to 0.



>In vfp 8 i would get the max integer key value in a table with:
>
>local lavalue[1]
>lavalue = .f.
>select max(fkey) from table into array lavalue
>
>lavalue[1] would return .f.
>
>in Vfp 9 sp1 this returns .NULL.
>
>I can change the select statement to
>select max(fkey) from table group by fkey into array lavalue
>
>and lavalue[1] will return .f.
>
>
>Code to test this
>
>create cursor ken (fkey I)
>local lavalue[1]
>
>lavalue = .f.
>select max(fkey) from ken into array lavalue
>? lavalue[1]
>
>I don't remember having this problem in Vfp 9
>has any one else had this problem?
>
>Ken
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform