I'm having trouble with a query that I thought would be pretty
straightforward. To simplify, I have a database of books that
has, say, two tables: 

CREATE TABLE book (
    id           INT,
    date_purch   DATE
)

CREATE TABLE subj (
    book_id      INT,
    subj         TEXT
)

Each book can have any number of subjects, and each book has
at least one subject.

I'd like to get all subjects that are in the subject table
that are _not_ represented in a particular date range. For
example, if I have bought books with subjects 'Computing',
'Cooking', 'Baseball', and 'Fiction', but in the last six
months I have only bought Fiction and Baseball, I'd like a
query that will give me Computing and Cooking.

I played around with a few LEFT JOINS but I still seem to be
missing something.

Thanks.

Jesse Sheidlower


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to