Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3680518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:35:09+00:00 2026-05-19T03:35:09+00:00

Lately i been doing some work on my MySql class in php and as

  • 0

Lately i been doing some work on my MySql class in php and as result of optimizing some parts of my code i would like to narrow some function count down.
I am really having hard time to work with 3 or more tables because it’s getting really confusing there. I don’t have a lot experience working with MySql or any other database, but i know the basics and little bit more.

And for the problem i can’t figure our how to make statement like so:

[table1 – users.email] AND [table2 – subscribers.email] NOT IN [table3 – check.email]

In words that would look like “Get me all unique user emails from [table1] and [table2] that are not in [table3] and put them in 1 list “

By 1 list i mean the same as this statement does it

SELECT u.email FROM users AS u UNION
SELECT s.email FROM subscribers AS s

Thanks in advance, please say if you need any more information.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:35:10+00:00Added an answer on May 19, 2026 at 3:35 am

    You left join the 3rd table and then do “where t3.field IS NULL”

    example:

    SELECT u.email FROM users AS u 
    LEFT JOIN table3 t3 ON u.email = t3.email
    WHERE t3.email IS NULL
    UNION 
    SELECT s.email FROM subscribers AS s
    LEFT JOIN table3 t3 ON s.email = t3.email
    WHERE t3.email IS NULL
    

    You need to make this distinct as well to get unique results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been doing some work lately with a Pre-compiled .NET3.5 app so i
I've been doing some work lately on a project that makes extensive use of
Lately at work, I've been doing some translation from Makefiles to an alternative build
I've been doing some Web-Projects lately that rely on heavy Data-Binding and have been
We've been doing a lot of work with LINQ lately, mainly in a LINQ-to-Objects
I've been doing a lot of work with Flex/Flash/Away3D lately, and have started looking
Lately I've been writing some JS code using jQuery and JavaScript as it is
I have been doing some reading lately one article I read was from Opera.
Lately I have been doing some numerical method programming in C. For the bug
I've been doing some Prolog lately. And I've read The Art Of Prolog book.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.