opposite of INNER JOIN

Results 1 to 2 of 2

Thread: opposite of INNER JOIN

  1. #1
    Join Date
    Dec 1969

    Default opposite of INNER JOIN

    How do you do the opposite of an inner join, whereas I have 2 tables... emailsTable and bademailsTable. I want to SELECT * FROM emailsTable WHERE emailaddress NOT IN bademailsTable.<BR><BR>In other words, "FROM emailsTable INNER JOIN bademailsTable" would only pull records from the emailsTable that are ALSO in the bademailsTable, but how do I do the opposite. Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: opposite of INNER JOIN

    just use a subquery<BR><BR>SELECT whatever FROM table1 WHERE joined_field NOT IN (SELECT joined_field FROM table2)<BR><BR>or you can do a LEFT OUTER JOIN with a filter on NULL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts