Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL aggregate
Message
 
 
À
26/03/2010 09:03:50
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01457370
Message ID:
01457424
Vues:
34
Correct but you know that I meant that, right? :).

>Good question ::) I must have been focused on it from former ideas.
>
>just
>
>
>IF tnGroup <> pnGroup 
> pnGroup = tnGroup
> ...
>
>
>and it is o.k.
>
>Agnes
>>I'm not sure why you would need a subquery
>>
>>CREATE CURSOR crsTest (pk i autoinc, grp i, bitfld i)
>>
>>FOR i=1 TO 5
>>	FOR j= 1 TO 4
>>		INSERT INTO crsTest (grp, bitfld) VALUES (i,j* 10^i)
>>	ENDFOR
>>ENDFOR
>>
>>pnResult = 0
>>pnGroup = 0
>>
>>SELECT grp, MAX(BitorSql(grp, bitfld)) AS BitField ;
>>	FROM crsTest ;
>>	GROUP BY grp
>>RETURN
>>
>>
>>FUNCTION BitorSql(tnGroup, tnVal)
>>IF tnGroup <> pnGroup 
>>	pnResult = 0
>>ENDIF	
>>pnResult = BITOR(pnResult, tnVal)
>>RETURN pnResult
>>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform