Jump to content

[SOLVED] How to compare values that don't exist in one table?


benphp

Recommended Posts

I have 2 tables, "users" and "resp".

 

users:

Last | First | uid

 

resp:

val1 | val2 | uid

 

I want to find out who in "users" does not have a record in "resp".

 

I've tried:

 

SELECT DISTINCT users.first, users.last FROM users RIGHT JOIN resp ON users.uid = resp.uid WHERE resp.uid IS NULL;

 

but it doesn't work of course. How do I do this?

 

Thanks!

 

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.