RE: Emulating a subselect

2002-03-17 Thread Mark Hendley
USING NOT IN will exclude reports that nobody has ... which I'm not sure is the outcome he was after - It was my first thought as well but the actual solution (assuming reports someone isn't signed up for includes reports that nobody is signed up for) is quite simple I think - just change the wher

RE: Emulating a subselect

2002-03-17 Thread Mark Hendley
Ack .. ignore the part of my last post re the original query not working :) ... it will as the user_id column will be null for reports notbody has and this will fail the where clause my mistake. the LEFT join is redundant, however, and the replacement I posted will also work ... Anyway - hav

RE: Emulating a subselect

2002-03-17 Thread Mark Hendley
how about just change the WHERE clause to : WHERE reports_signup.user_id != '2' (or whatever user_id) ie: does not equal. That should grab all reports they are not signed up for and the left join will include all reports that nobody is signed up for (left-overs). Another issue is that you're o

RE: Retrive distinct data from two tables

2002-03-14 Thread Mark Hendley
Try: SELECT B.name FROM B LEFT JOIN A ON A.name = B.name WHERE A.name is null; -Original Message- From: Pichan M. [mailto:[EMAIL PROTECTED]] Sent: Thursday, 14 March 2002 12:19 PM To: [EMAIL PROTECTED] Subject: Retrive distinct data from two tables I have 2 tables, let says, table A an