Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select SQL
Message
De
22/05/1997 09:51:26
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00033226
Message ID:
00033260
Vues:
34
>>>How do I select SQL if I want to display all records which contain at least
>>>one of the values to be compared.
>>>I made a table which have a field of keywords.
>>>The Keywords are those to be used as a clue values when I query.
>>>They are several comma-delineated clue words such as
>>>- shoes,nike,addidas,sports,snickers,health -
>>>In case I want to search all the records which contain word "sports" in any
>>>place of keyword field, How do I do that?
>>>I'd like to make an search form similar to the Yahoo, Infoseek....
>>>Would you please help me out?
>>
>>try :-
>>
>>select iif(yourfield $ yourlist, yourfield, "") into table yourtable
>>
>>then
>>dele all for empty(yourfield)
>
>Depending on how big your look-up needs are... you may want to investigate a third party product. Like the one MT uses here, Phd... But, if you are only going to have a few look-ups instead of hundreds, the above approach would be the way to go...

After re-reading your questions, I believe that you should create a child dbf and store individual keywords in it. Otherwise your program will get very slow, very quickly.

Then you could store the keywords in a variable like
searchlist=["sports","nike","shoes"]
and your select could be like

select target.* from target,child where target.id=child.id and child.keyfield in (&searchlist))
L.A.Long
ProgRes
lalong1@charter.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform