Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Posts
    132

    Unanswered: How to make an excluding table or query?

    There are two tables. One table is the student name and characteristics from schoolA during the last 20 years. The second table contains the student names and characteristics from California university during the last 20 years. Obviously, some but not all the university students have come from schoolA. How can we find:
    1- students form school A who did not go to California university.
    2- students from California university who did not come from School A.
    Thank you
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    1.
    Code:
    SELECT * 
    FROM [school A] 
    LEFT JOIN [California university]
    ON [school A].[Student ID] = [California university].[Student ID]
    WHERE [California university].[Student ID] IS NULL.
    2.
    Code:
    SELECT * 
    FROM [California university]
    LEFT JOIN [school A] 
    ON [California university].[Student ID] = [school A].[Student ID]
    WHERE [school A].[Student ID] IS NULL.
    Replace the text between square brackets with the names of your tables and ID columns.
    Have a nice day!

  3. #3
    Join Date
    May 2012
    Posts
    132
    thank you very much
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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