Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2007
    Posts
    1

    Question Unanswered: Is there a way to have list of NOT words with containstable?

    This works when @searchString is used in containstable (provided searchString has value)...

    set @searchStringNoneOfWords = 'not(Airplane)'
    SET @searchString = @searchString + ' AND ' + @searchStringNoneOfWords

    This does NOT work when @searchString is used in containstable...

    set @searchStringNoneOfWords = 'not(Airplane)'
    SET @searchString = @searchStringNoneOfWords

    I understand it is because the syntax is AND NOT, but what if I have a list of words that I do not want included? How do I start out with a NOT using containstable? It is kind of like Google's advanced search except that if you enter a word in the "without words" section with the other fields blank it would return everything under the sun except for things found with those words.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Err...
    Code:
    WHERE field NOT IN (1,2,3,4)
    
    WHERE field NOT IN ('A','B','C')
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •