0

I have sql query as shown below

        SELECT ID,[description1],[description2]
        FROM [instance]
        WHERE CONTAINS([description2],'"*ECSB10*"') 

It is giving following rows with description2 value 'VA-7000-ECSB02-1B-MGMT' even though description2 column does not contain keyword ECSB10, Can anyone explain why is it returning like this.

result

  • Possible duplicate of [MySQL query String contains](http://stackoverflow.com/questions/2602252/mysql-query-string-contains) – Brian Cheong May 09 '17 at 07:56
  • 1
    Full-Text Search is *language* based, not *string* based. I wouldn't be surprised if it's stripping the digits from your input since *those aren't part of a word*. – Damien_The_Unbeliever May 09 '17 at 07:57
  • @Damien_The_Unbeliever , if it strips digits, then the result should be same if I use '"*ECSB20*"' as filter, instead it is returning zero rows – user3094013 May 09 '17 at 08:41
  • it seems like my full text search index has not been build properly – user3094013 May 18 '17 at 10:22

2 Answers2

0

SELECT column1, column2, column3 FROM table_name WHERE column2 LIKE '%{$...}%'

Brian Cheong
  • 43
  • 2
  • 14
0

I think you better use LIKE:

SELECT ID, [description1],[description2]
FROM [instance]
WHERE [description2] like '%ECSB10%'
xGeo
  • 2,149
  • 2
  • 18
  • 39