List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:June 1 1999 5:58pm
Subject:Re: Query help: Free-text search for (NOT keyword)
View as plain text  
Stefan Möhl wrote:
> 
> Hello SQL-wizards!
> 
> I have problems with building a query while doing free-text search. I
> have a database of documents stored in a table, each with a docID.
> Each word in a document is also stored in a word list. The word list
> consists of word-docID pairs, so that I can perform fast free-text
> searches for documents. I am having problems when constructing a
> query where I try to find all documents that do NOT match a keyword.
< cut > 

Hi Stefan

I would do this with a LEFT JOIN like this:
SELECT
	docs.text
FROM
	docs
	LEFT JOIN words ON (docs.docID = words.docID AND words.word = 'keyword')
WHERE
	words.word IS NULL

Tschau
Christian

Thread
Query help: Free-text search for (NOT keyword)Stefan Möhl1 Jun
Re: Query help: Free-text search for (NOT keyword)Alexander I. Barkov1 Jun
Re: Query help: Free-text search for (NOT keyword)Christian Mack1 Jun
  • Re: Query help: Free-text search for (NOT keyword)Stefan Möhl2 Jun
  • Re: Query help: Free-text search for (NOT keyword)Benjamin Pflugmann3 Jun
Re: Query help: Free-text search for (NOT keyword)jonathan michaels4 Jun
  • Re: Query help: Free-text search for (NOT keyword)James Rogers4 Jun