Results 1 to 5 of 5
Thread: Two Tables Checking
Aug 23, 2009, 19:52 #1
Two Tables Checking
I am learning how powerful MySQL is and hoping this is possible. I've gone through some documents before I asked so please don't be mad. I don't have my MySQL book in the mail yet, or I'd also refer to it.
What Im trying to do:
1. Take all the ID's from the User Table AND all the assigned users from Project Users (So I can compare the two)
2. Compare all the Users ID's to the ones in the Project Users Table.
3. But Only Take ones that are NOT matching,
4. And only Check on the currently selected project. (ie: 3)
I can get it to work for Users.ID = Project_Users.User_ID,
But not ones that DONT match.
I have a list of users with an ID:
Table: users ID Login 0 John 1 Mark 2 JamesCode:
Table: project_users Project_ID User_ID 0 3 1 0 1 2
Aug 23, 2009, 22:10 #2
- Join Date
- Aug 2000
- Philadephia, PA
- 1 Post(s)
- 0 Thread(s)
All the users that are NOT assigned to project 3:
SELECT users.ID FROM users LEFT OUTER JOIN project_users ON users.ID = project_users.User_ID WHERE project_users.Project_ID = 3 AND project_users.User_ID IS NULLTry Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
Aug 23, 2009, 22:32 #3
Aug 24, 2009, 00:13 #4
Aug 24, 2009, 05:23 #5