Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group 2 fields, omit duplicate values
Message
 
 
To
28/10/2010 10:09:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01487370
Message ID:
01487426
Views:
62
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform