Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
My query is below:
SQL
SELECT FT_TBL.ID,FT_TBL.Description,KEY_TBL.[KEY], KEY_TBL.rank FROM Test AS FT_TBL INNER JOIN CONTAINSTABLE (Test, Description, '(method NEAR system)', 2) AS KEY_TBL ON FT_TBL.ID = KEY_TBL.[KEY];

I set distance to 2 but it displays all records. Have any changes in my query or any idea?
I m using SQL server 2008.
Posted
Updated 10-Jan-13 21:16pm
v2
Comments
Sergey Alexandrovich Kryukov 11-Jan-13 3:01am    
2 is too near, use 4-5 :-)
—SA
Maciej Los 12-Jan-13 17:59pm    
Good answer, my virtual 5!
Sergey Alexandrovich Kryukov 12-Jan-13 19:47pm    
Thank you very much, Maciej :-)
gunaaa 14-Jan-13 23:57pm    
My Description column values is below

Description:
1)operation method and communication system thereof
2)Method and system for zone-based capacity control

There are two values in description field.
If i set the search values are method and system and distance value is 2 using near operator in sql server 2008 it will be displayed result as "operation method and communication system thereof"...

Can you please help me?

1 solution

Have you seen it: http://msdn.microsoft.com/en-us/library/ms189760.aspx[^]?

In your example, 2 means: top_n_by_rank, returns the description of the top 2 records where the Description column contains the word "method" near either the word "system".

We need more details to help you... ;(
 
Share this answer
 
Comments
gunaaa 15-Jan-13 23:26pm    
My Description column values is below

Description:
1)operation method and communication system thereof
2)Method and system for zone-based capacity control

There are two values in description field.
If i set the search values are method and system and distance value is 2 using near operator in sql server 2008 it will be displayed result as "operation method and communication system thereof"...

Can you please help me?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900