Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select SQL
Message
From
26/05/1997 00:36:28
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00033226
Message ID:
00033598
Views:
51
>>>>>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?
>>snip-
>>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))
>
>
>I had a hard time to log onto U.T
>because an error has occurred to the internet service provider of mine.
>It's too late but I wanna ask you some more questions if you don't mind.
>If I understand you correctly,
>Do you mean that a record in a target table can have more than one
>corresponding record in the child table which contains Keywords?
>For instance,
>If the kewords of the current record is "black","color","paint","red"
>Should I make three corresponding records in child keyword table
>each contains one of the keywords and target Id?
>If it's true, is there any possiblity that the child table's gonna have too many records?
>Is it still fast enough when the number of records gets over 100,000?
Absolutely. A search on an indexed file will always be faster than parsing through a field containing multiple entries...especially if you are looking at 100k or more possible entries.
p.s. I would use "select distinct target.*....."
L.A.Long
ProgRes
lalong1@charter.net
Previous
Reply
Map
View

Click here to load this message in the networking platform