At 09:24 AM 11/17/2004, Rick Faircloth wrote:
>Good morning, all...
>
>I'm using MySQL (4.0) version, which doesn't support
>subqueries, so I need to rewrite this as a join query...how would I do that?
>
>Select CAL.EmailAddress
>    from classroom_access_list CAL
>where CAL.EmailAddress
>  not in (Select S.EmailAddress from staff S)
>
>What I'm after is a query that gives me all the email addresses in the
>classroom_access_list table and the staff table without duplicates...

Not too sure, but something like

SELECT DISTINCT EmailAddress
FROM
   SELECT EmailAddress
   FROM classroom_access_list
   UNION
   SELECT EmailAddress
   FROM staff

Since you don't want the two sets of results to actually
key together, a union makes more sense: just append the
results of one to the bottom of the other. Then the distinct
will find all the unique ones. However.... I just realized
that this may count as a subquery too!

Anders
+===========================================================+
|Anders Green                 Email: [EMAIL PROTECTED]       |
|                              Home: 919.303.0218           |
|        Off Road Rally Racing Team: http://LinaRacing.com/ |
| Do you like Evite? This is better: http://RSVPtracker.com/|
+===========================================================+


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184581
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to