Hope this sql-only (no ruby) question is okay.  I have a table "users"
which has user_id and name fields.

I have a table "users_colors" which has user_id and color fields with a
many-to-many relationship with users.

For simplicity, say that the color field is either "red" or "green".  A
user can be in the color table no times, once ("red" or "green"), or twice
(once "red", once "green".)

I'm trying to come up with an sql query that will tell me all of the users
that are "red" but are not "green".  Not sure I can get what I want with a
left outer join, but I'm not at all handy with the left join, so maybe I'm
missing something.

Any ideas?

Thanks!

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to