select distinct PersonID
from PersonProject
where ProjectID != '2';

Is this what you are looking for?

Simon 

-----Original Message-----
From: Glenn Wearen [mailto:[EMAIL PROTECTED]]
Sent: 17 July 2001 14:18
To: '[EMAIL PROTECTED]'
Subject: Simple SQL Query?


How can I get a list of all PersonID's who are not in ProjectID 2 (i.e.
PersonID 3 and 4)?

Table: PersonProject

PersonID        | ProjectID
-------------------
1               | 1
2               | 1
3               | 1
1               | 2
2               | 2
1               | 3
2               | 3
3               | 3
4               | 3


BTW "SELECT PersonID from PersonProject where ProjectID != '2'" doesn't work


---------------------------------------------------------------------
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

---------------------------------------------------------------------
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