List:General Discussion« Previous MessageNext Message »
From:M Wells Date:February 26 2003 5:55am
Subject:Help needed with SQL...
View as plain text  
Hi All,

I'm having problems creating a query to return a recordset from the
following situation:

I have two tables, one which contains member details, and the other
which contains details re: the groups to which the member belongs.

When a member logs into a particular part of my site, I want to show
them the details of the other people who belong to the same groups they
do.

Let's say my Members table looks like this:

memberid, membername, memberemail

1, john doe, johndoe@stripped
2, jane doe, janedoe@stripped
3, joe bloggs, joebloggs@stripped
4, inigo montoya, inigo@stripped

And my Groups table looks like this:

groupname, memberid

group1, 1
group1, 2
group2, 1
group2, 4
group3, 3

So, if I passed the query the memberid value of '1', I'd like to return
a a unique records recordset of:

1, john doe, johndoe@stripped
2, jane doe, janedoe@stripped
4, inigo montoya, inigo@stripped

Can anyone help me work out how to achieve this?

Many thanks in advance!

Regards and best wishes,

Murray Wells


Thread
Help needed with SQL...M Wells26 Feb
  • RE: Help needed with SQL...Don Read26 Feb
RE: Help needed with SQL...Jun.Han26 Feb
  • RE: Help needed with SQL...Don Read26 Feb
    • Re: Help needed with SQL...Sheryl Canter26 Feb
    • Re: Help needed with SQL...Tore Bostrup26 Feb