Quote:
|
name - name of group(PK because no duplicates)
|
If more than one user can belong to a group then it isn't a good primary key, use userid instead.
Also in your second table if a user can share a cell number with someone else it also isn't a good primary key. It is if no one can share a number.
For your join, use a left outer join and test for not null
Code:
SELECT name FROM wsmsgroups
LEFT OUTER JOIN
wsmscontacts
ON wmsgroups.userid = wsmscontacts.userid
AND contact IS NOT NULL