Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
Subject: RE: problem with strings
Thread ID: 103457 Message ID: 103468 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: General VFP Topics
Date: Friday, August 4, 2006 12:34:22 PM         
   



> > Dear Experts!
> > I have 02 tables:
> >
> > table1
> > phyto_no
> > PCKS/33857/-06-07
> > PCKS/33858/-06-07
> > PCKS/790/06-07
> > PCKS/1381/06-07
> > PCKS/1487/06-07
> > PCKS/2032/06-07
> > PCKS/306/-06-07
> > PCKS/308/-06-07
> >
> >
> > table2
> > phyto_no
> > PCKS/33857/-06-07
> > PCKS/33858/-06-07
> > PCKS/790/06-07
> > PCKS/1381/06-07
> > PCKS/1487/06-07
> > PCKS/2032/06-07
> > PCKS/306/-06-07
> > PCKS/308/-06-07
> > PCKS/01/790/06-07
> > PCKS/01/1381/06-07
> > PCKS/01/1487/06-07
> > PCKS/01/2032/06-07
> > etc...
> >
> > I have problem in matching charcter strings. i use the following select query
> >
> > SELECT * from table1,table2 WHERE UPPER(table1.phyto_cert) = UPPER(table2.phyto_cert) INTO CURSOR cst
> >
> > Result are as follows:
> >
> > PCKS/790/06-07
> > PCKS/1381/06-07
> > PCKS/1487/06-07
> > PCKS/2032/06-07
> >
> > while other phyto nos are missings.i think there is a problem in converting strings with characters like /,-,: etc.
> >
> > plz help me!
> >
> > naveed

>
> When you need to get the results from both tables you need to KOIN them, not to filter them. Try this:
>
> SELECT table1.*;
>        from table1
> INNER JOIN Table2 ON UPPER(table1.phyto_cert) = UPPER(table2.phyto_cert);
> INTO CURSOR cst
> 

> Borislav Borissov
>
>


Should read

... you need to JOIN them

If you want all records, an inner join will not do. This will only give you the records from both tables that actually have a match.

You can use a LEFT OUTER JOIN to give you all of the records from the FROM table plus all of the matching from the JOINed table. Right outer join goes the other way. Full joins give you all the records from both tables.

Ken

You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

problem with strings Posted by naveed shahid @ 8/4/2006 11:43:05 AM
RE: problem with strings Posted by Borislav Borissov @ 8/4/2006 12:00:58 PM
RE: problem with strings Posted by Ken Murphy @ 8/4/2006 12:34:22 PM
RE: problem with strings Posted by Borislav Borissov @ 8/4/2006 1:59:23 PM
RE: problem with strings Posted by Ken Murphy @ 8/4/2006 2:58:52 PM
RE: problem with strings Posted by naveed shahid @ 8/4/2006 3:04:47 PM
RE: problem with strings Posted by Borislav Borissov @ 8/4/2006 3:11:16 PM
RE: problem with strings Posted by naveed shahid @ 8/5/2006 2:00:30 PM
RE: problem with strings Posted by Tamar Granor @ 8/7/2006 10:58:36 PM
RE: problem with strings Posted by Ken Murphy @ 8/4/2006 3:12:35 PM
RE: problem with strings Posted by Borislav Borissov @ 8/4/2006 3:18:40 PM
RE: problem with strings Posted by Ken Murphy @ 8/4/2006 3:23:15 PM
RE: problem with strings Posted by Pete Sass @ 8/4/2006 8:01:21 PM
RE: problem with strings Posted by Ken Murphy @ 8/4/2006 8:17:37 PM