I would like to get the difference of the results from query 2 and query 1,
or the people not attending event [id 2] (referenced by epeople.eid).
Thought the answer would be query three, but as you see, I get an empty
set. Any advice would be appreciated.
jb
Here is everyone attending the event [id 2]
1) mysql> select people.id as pid, concat(lastname, ", ", firstname) as
name from
-> epeople
-> left join people on epeople.pid=people.id
-> where epeople.eid=2;
+------+----------------------+
| pid | name |
+------+----------------------+
| 5 | Piovesan, Ron |
| 6 | Mossberg, Walt |
| 7 | Reporter, Jon |
| 8 | Analyst, Jon |
| 12 | Media, Karen |
| 15 | Galvin, Tom |
| 16 | Ogilvy, Tom |
| 17 | Machines, Industrial |
| 2 | Tenderich, Burghardt |
+------+----------------------+
9 rows in set (0.01 sec)
Here are all the people records:
2) mysql> select people.id as pid, concat(lastname, ", ", firstname) as
name from
-> people;
+-----+----------------------+
| pid | name |
+-----+----------------------+
| 1 | Collins, Stacey |
| 2 | Tenderich, Burghardt |
| 3 | Executive, Bea |
| 4 | Bea, Joe |
| 5 | Piovesan, Ron |
| 6 | Mossberg, Walt |
| 7 | Reporter, Jon |
| 8 | Analyst, Jon |
| 9 | Smith, Susan |
| 10 | Jane, Sarah |
| 12 | Media, Karen |
| 13 | PR, Bea |
| 14 | Relations, Public |
| 15 | Galvin, Tom |
| 16 | Ogilvy, Tom |
| 17 | Machines, Industrial |
+-----+----------------------+
16 rows in set (0.00 sec)
3) mysql> select people.id as pid, concat(lastname, ", ", firstname) as
name from
-> epeople
-> left join people on epeople.pid=people.id
-> where epeople.eid=2
-> and people.id is null;
---------------------------------------------------------------------
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