|
-
Nov 1st, 2006, 02:38 AM
#1
Thread Starter
Frenzied Member
Search db from aps.net...exclude data in other tables
3 tables apply here:
1) tblChinaProvinces
2) tblChinaCities (linked to province table via prov_id)
3) tblCompanies (id, name, city_id)
Most company names include the city and or province it's located in. Typical naming trend here in China.
Example: User search for company using the keyword "shang" will return all companies who's name contain cities/provinces like "Shanghai", "Shangdong" etc. and this result into really long search results. (basically "
Code:
SELECT * FROM tblCompanies WHERE name LIKE '%shang%'
)
So, without making the search operation hell slow, how can I exclude companies, who's names include entries in the city and province tables?
So far, in my head, everything I come up with will obviously slow things down, but then my SQL knowledge are pretty basic, so was hoping one of you guys can give me some idea.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|