I've got a database with 3 tables: users, groups, and groupmembers.
users:
id int
username varchar(50)
groups:
id int
name varchar(50)
groupmembers:
id int
groupid int
user int
Given two user ids, how can I use one query to determine if they share membership in any group (not any particular one, but any group). I'd like the query to return null if they share no membership and not null if they do share membership.