Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Match two tables by address
Message
De
05/10/2010 10:20:53
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/10/2010 20:00:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01483926
Message ID:
01483976
Vues:
37
>Hi all,
>
>I have 2 tables from flat files that I have to compare if they have the same addresses:
>
>table1 with 3 fields
>streetnum streetname city
>
>12345 bob ave New City
>
>table2 with 3 fields
>streetnum streetname city
>
>12345 bob ave New City
>
>My sql syntax is :
>
>select * from table1 where streetnum in ( select streetnum from table2 ) and streetname in (select streetname from table2) and
>city in (select city from table2) into cursor table3.
>
>Please correct my sql syntax because it is not working now and the city's length are not the same for table1 and table2.
>
>Thanks in advance,
Select t1.* ;
  From table1 t1 ;
  INNER Join table2 t2 ;
  ON Upper(t1.streetnum) == Upper(t2.streetnum) And ;
  UPPER(t1.streetname) == Upper(t2.streetname) And ;
  UPPER(t1.city) == Upper(t2.city)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform