1 message in com.mysql.lists.javaquestion ....
FromSent OnAttachments
Mufaddal Khumri21 Aug 2003 23:15 
Subject:question ....
From:Mufaddal Khumri (mufa@wmotion.com)
Date:08/21/2003 11:15:53 PM
List:com.mysql.lists.java

I had posted a message earlier yesterday and I realized that the result i was trying to get wont be the result of the query i was writing. Could someone help me on this please -

I have table survey:

+----+----------+---------+ | ID | NAME | ENABLED | +----+----------+---------+ | 1 | Survey1 | 1 | | 2 | Survey2 | 1 | | 3 | Survey3 | 1 | | 4 | Survey4 | 1 | | 5 | Survey5 | 1 | +----+----------+---------+

table res: +----+--------+------+------------------+ | ID | USERID | TYPE | SURVEYID | +----+--------+------+------------------+ | 1 | 1 | 1 | 1 | | 2 | 1 | 1 | 2 | | 3 | 1 | 1 | 3 | +----+--------+------+------------------+

I want all the survey records that follow the rule -- survey.id is not in res.surveyId. For example considering the example data in the two tables, when i run the query the result should have (4, survey4, 1) and (5, survey5, 1).

Could someone help me formulate the query ?

Thanks.