Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count probleme
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01237077
Message ID:
01237580
Vues:
14
Hi Bernhart,

You're welcome.

>
>Wonderfull !
>
>A big thank....sergey
>
>
>bernhart
>
>>Hi Bernhart,
>>
>>Your data doesn't have record order info in it which makes it impossible to achive what you want with UPDATE-SQL command. If you add column that defines data order than it becames simple
>>
>>CREATE CURSOR CmdMedic ( pk I autoinc, cNom C(20) , nGroup I )
>>INSERT INTO CmdMedic ( cNom ) VALUES ( 'Temesta 2.5' )  	&& I want 1 For ngroup
>>INSERT INTO CmdMedic ( cNom ) VALUES ( 'Aspirine' ) 		&& I want 1 For ngroup
>>INSERT INTO CmdMedic ( cNom ) VALUES ( 'Temesta 2.5' ) 		&& I want 2 For ngroup
>>INSERT INTO CmdMedic ( cNom ) VALUES ( 'Fluimycyl' ) 		&& I want 1 For ngroup
>>INSERT INTO CmdMedic ( cNom ) VALUES ( 'Rofenid' )			&& I want 1 For ngroup
>>INSERT INTO CmdMedic ( cNom ) VALUES ( 'Temesta 2.5' )		&& I want 3 For ngroup
>>
>>UPDATE CmdMedic SET nGroup = (SELECT COUNT(*) FROM CmdMedic cm2 ;
>>		WHERE cm2.cNom = CmdMedic.cNom AND cm2.pk < CmdMedic.pk) + 1
>>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform