Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement