+ Reply to Thread
Results 1 to 2 of 2

Show data that is not found in another table

  1. #1
    Registered User
    Join Date
    04-29-2009
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    1

    Show data that is not found in another table

    I'm working on a classes database with specific users. When a user checks off a class as complete, it is added to a "ClassUser" table with the specific classID as well as the userID that completed the class. Now what I want to do is show a list of classes that the user has NOT taken from the primary Classes table.

    So far, I have this SQL statement.

    Please Login or Register  to view this content.
    This gives me a list of all classes found in the Classes table that are NOT in the ClassUser table. This is almost what I want, but now I want to add another condition so it only returns classes that userID=20 has not taken.

    As of now this SQL statement returns the classes that all of the users haven't taken but I want to only see the classes that a specific user hasn't taken.

    I've tried AND WHERE user_id=20 ,but I get no results from that.

    Does anyone have any ideas?

    http://imgur.com/2EA1.jpg

    That is a picture of my current tables.

    Once again, my goal is to display the list of classes that a specific user has not taken, where the table "ClassUser" represents the classes that a specific user has taken.
    Last edited by marcuswilderby; 04-29-2009 at 12:39 AM.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Show data that is not found in another table

    Hi marcuswilderby,

    Try this:

    Please Login or Register  to view this content.
    Cheers,

    P.S. ~ Are you in the same class with jimmycantler?
    Last edited by ConneXionLost; 04-29-2009 at 03:11 AM.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1