Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select problem
Message
De
01/08/2000 18:44:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00398108
Message ID:
00399654
Vues:
17
>Hi Brien,
>I prefer the Jim's way because the user can generate the SQL SELECT by using values from the different tables. I send here the very easy sample to describe my problemm.
>In that table user can input not only languages but type of scool, the qualifications etc. etc. so I made some sort of query maker which gives to user pissibilities to make deifferent reports from this table. So I don't know how many times I need to slef-link table.
>
>Boris

Hi:

PMFJI (Just learned what that means and this is first time I've had a chance to use it)

If the users can
1. Pick the field they want to compare on (sel_field)
2. Pick the values they want to check for ("English", "French")

and assuming that the user wants to find people with all the skills selected

you might try something like:

cField = (Field Name the User Picked)
DIME aCheckVals[N] && Populate aCheckVals with the list of items

SELECT name FROM people ;
WHERE ASCAN(aCheckVals,&cField) > 0;
GROUP BY name HAVING COUNT(*) = ALEN(aCheckVals)



You could easily modify this query to get all with some number of the skills (2 of 3 requested languages, for example)



On large tables this query might be too slow, but it should be generic enough to work in most cases.


HTH................Rich
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform