Jump to content

[SOLVED] Select results NOT in a table


jyushinx

Recommended Posts

Hi,

 

I am having an issue developing a query to fit a specific need I have. I know what I want to do conceptually, but I don't know how to translate it into SQL. Let me explain:

 

I have a Users table. The Primary Key in this table is UserId. I also have an EventSignUp table. Basically, users can sign up for particular Events, so the Events table consists of a match up of UserId and EventId.

 

What I am trying to do is retrieve all the users who have NOT signed up for a particular event. So given an EventId of 10, I would want to retrieve all the UserIds from the User table where there is not a match up of the UserId and 10 (the EventId) in the EventSignUp table.

 

 

 

I hope this is clear enough. If anyone needs further explanation, just say so. Thanks for your help.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.