Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server-2008
My query is below:
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 10-Jan-13 20:44pm
gunaaa501
Edited 10-Jan-13 21:16pm
v2
Comments
Sergey Alexandrovich Kryukov at 11-Jan-13 3:01am
   
2 is too near, use 4-5 :-) —SA
Maciej Los at 12-Jan-13 17:59pm
   
Good answer, my virtual 5!
Sergey Alexandrovich Kryukov at 12-Jan-13 19:47pm
   
Thank you very much, Maciej :-)
gunaaa at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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... ;(
  Permalink  
Comments
gunaaa at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 529
1 OriginalGriff 307
2 Damith Weerasinghe 295
3 ravikhoda 260
4 Tadit Dash 180
0 Sergey Alexandrovich Kryukov 10,974
1 OriginalGriff 6,667
2 Peter Leow 4,760
3 Abhinav S 3,813
4 Maciej Los 3,565


Advertise | Privacy | Mobile
Web02 | 2.8.140421.2 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid