MySQL Forums
Forum List  »  PHP

Re: A Kind of Reverse Join
Posted by: Barry Galbraith
Date: June 07, 2012 03:31AM

>Note that a subquery is here superfluous to requirements!

Yes, you are right, I had brain block earlier, but a flash of brilliance has just produced this.

mysql> SELECT m.fname
    ->      , m.lname
    ->  FROM members m
    ->  LEFT JOIN  memevent  me
    ->  ON me.mem_id = m.mem_id AND me.event_id = 1
    ->   WHERE me.mem_id IS NULL
    ->  ;
+-------+-------+
| fname | lname |
+-------+-------+
| Joe   | Moore |
| Tom   | Lee   |
| Adam  | Jones |
+-------+-------+
3 rows in set (0.00 sec)

mysql>

Proves there's more than one solution, no?

Good luck,
Barry.



Edited 1 time(s). Last edit at 06/07/2012 03:40AM by Barry Galbraith.

Options: ReplyQuote


Subject
Written By
Posted
June 05, 2012 01:35PM
June 06, 2012 01:33PM
June 06, 2012 01:31PM
Re: A Kind of Reverse Join
June 07, 2012 03:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.