Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-09-27 : 09:05:53
|
| Beni Angek writes "Hi,I saw one of your other articles on ranking, but I'm trying to do 1 up on that result.I'm doing a query to find some results and sort them in ranking order by using difference. I'm trying to do it via 3 fields instead of one. Trying to rank the direct link e.g. search for Tax will rank Tax above Tax FAQ...Fields:IDNameShortDescrWholeDescrSearching for the string 'tax'Query looks like this:select *difference(Name) as NameResultfrom Table where (Name like '%tax%' or ShortDescr like '%tax%' or WholeDesc like '%tax%order by difference(Name) desc,difference(ShortDescr) desc,difference(WholeDescr) descRecords:ID | Name*********1 | Tax Page2 | 2004 Tax returns3 | AGA syllabi4 | Testing's tax page5 | TaxThe funny thing is that record 2 has a difference result of 2 even though it has a direct Tax record.I found out that the soundex takes the first letter of the record then uses the binary (or something).How can i do the query that so that if there is a direct match then it ranks higher e.g rank them in this order:ID*********51243Many thanks,Beni" |
|
|
Shurgenz
Yak Posting Veteran
51 Posts |
Posted - 2004-09-29 : 03:32:24
|
| The difference function requires 2 arguments. |
 |
|
|
|
|
|