DB2 Version 9.7 for Linux, UNIX, and Windows

Searching with the Boolean operator NOT

You can use the Boolean operator NOT to exclude particular text documents from the search.

Example

For example:
SELECT AUTHOR, TITLE
        FROM DB2EXT.TEXTTAB
        WHERE CONTAINS(COMMENT, 
               '("author", "pulitzer") & NOT "book"') = 1

This example excludes any text documents containing the term “book” from the search results for “author” or “pulitzer”.