Need help with SQL query. Keyword matching.
- From: david@xxxxxxxxxxx
- Date: 27 Jul 2005 08:50:27 -0700
Hi all,
I have two tables:
workgroups (wg_id, wg_name)
workgroups_keywords (wgk_wg_id, wgk_keyword)
Each workgroup has an associated list of one or more keywords.
What I want do to at first was given a particular list of keywords
bring back a list of workgroups that have at least one matching keyword
associated with it.
I have the following query:
select distinct(wg_id), wg_name
from workgroups, workgroups_keywords
where
wgk_keyword in (#QuotedValueList(Keywords.wgk_keyword)#)
and
wg_id = wgk_wg_id
order by wg_name
This works great.
However, is there a way in a single query to order the returned rows by
the number of keywords that are found to be matching (in other words an
order by relevancy, the more keywords that match the more relevant the
returned row)?
Thanks in advance.
David
.
- Follow-Ups:
- Re: Need help with SQL query. Keyword matching.
- From: Hugo Kornelis
- Re: Need help with SQL query. Keyword matching.
- From: Erland Sommarskog
- Re: Need help with SQL query. Keyword matching.
- Prev by Date: Re: Easy question on UPDATE
- Next by Date: Re: Need help with SQL query. Keyword matching.
- Previous by thread: Easy question on UPDATE
- Next by thread: Re: Need help with SQL query. Keyword matching.
- Index(es):
Relevant Pages
|