Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group 2 fields, omit duplicate values
Message
 
 
À
28/10/2010 10:09:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01487370
Message ID:
01487426
Vues:
63
You don't need intermediate cursor. Try
create cursor test (fld c(4))
insert into test values ('ABC')
insert into test values ('CBA4')
insert into test values ('BDC')
insert into test values ('EG')
insert into test values ('C22F')
insert into test values ('2DB')
insert into test values ('FE')
insert into test values ('ADER')

SELECT t1.fld as fld1, t2.fld as fld2 ;
	 FROM test t1 JOIN test t2 ON t2.fld <= t1.fld ;
	 INTO CURSOR mycursor
>
>I have cursor (name is mycursor) with two fields .
>Example:
>
create cursor test (fld c(4))insert into test values ('ABC')
>insert into test values ('CBA4')
>insert into test values ('BDC')
>insert into test values ('EG')
>insert into test values ('C22F')
>insert into test values ('2DB')
>insert into test values ('FE')
>insert into test values ('ADER')
>
>select fld as fld1 from test into cursor test1
>select fld as fld2 from test into cursor test2
>
>select * from test1,test2 into cursor mycursor
>
>on "Mycursor" you can see one row with fld1=ABC and fld2=BDC and another row with with fld1=BDC and fld2=ABC.
>How can I void it? (it is not important form me what to omit).
>
>sorry for my poor english
>Tnx
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform