Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search
Message
De
17/07/2008 12:39:45
 
 
À
10/07/2008 06:14:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: Search
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01330151
Message ID:
01332023
Vues:
13
Here is another possible solution:

Assuming you have a unique key for each person, create a table of names and unique keys

select namekey, name1 as name from yourpeopletable;
union;
select namekey, name2 as name from yourpeopletable;
union;
select namekey, name3 as name from yourpeopletable;
union;
select namekey, name4 as name from yourpeopletable;
into table allnames

parse the NameField into individual names (NameA, NameB, NameC, NameD) and then execute
one of four select statements depending on the number of names in the search field. Here
is the query for 4 names

SELECT namekey FROM allnames where name = &NameA AND namekey in (;
SELECT namekey FROM allnames WHERE name = &NameB AND namekey in (;
SELECT namekey FROM allnames WHERE name = &NameC AND namekey in (;
SELECT namekey FROM allnames WHERE name = &NameD)))
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform