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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Display Results based on Percentage Match

Author  Topic 

frank.svs
Constraint Violating Yak Guru

368 Posts

Posted - 2008-05-05 : 09:58:01
Dear Pals,

I have small requirement in my project.
I need to display the results of the WHERE clause based on percentage/ranking of exact match.

I mean the result set should be displayed based on percentage match.

For example i have the below table.

create table test
(
id int identity(1,1) primary key,
ename varchar(10)
)

insert into test(ename) select 'REG'
insert into test(ename) select 'xyz'
insert into test(ename) select 'abc'
insert into test(ename) select 'Reg'
insert into test(ename) select 'Regsxysn'
insert into test(ename) select 'psReg'

I need the output something similar as below

REG
Reg
Regsxysn
psReg

I have tried out with full text indexing but i could'nt get the required output.

Any suggestions would be appreciated.

Thanks in Advance.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-05 : 10:43:37
How do you define an exakt match?
How do you calculate mismatches?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-05 : 10:44:28
Have a look at CONTAINSTABLE function in books online.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-05 : 10:47:50
http://msdn.microsoft.com/en-us/library/ms189760.aspx


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -