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
https://forums.phpfreaks.com/topic/75857-solved-select-results-not-in-a-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.