I am trying to join to tables:
users:
uid name
1 john
2 jim
3 mary
groups:
groupid groupname groupowner groupcreator
1 test1 1 1
2test2 1 2
3 test32
Kris zoob-at-doomstar.com |Lists| wrote:
I am trying to join to tables:
users:
uid name
1 john
2 jim
3 mary
groups:
groupid groupname groupowner groupcreator
1 test1 1 1
2test2 1 2
3
No offense but your response has created more confusion about this..
Here is a more simple diagram for what I'd like to get from an SQL query:
Table users:
uid username
1 john
2 jim
3 mary
Table groups:
id name creator owner
1 test 11
2 abc 1
How so? Is there something you didn't understand? Peter's solution is the
right idea. You need to join the groups table to the users table once to
get the creatorname and again to get the ownername. Maybe it will be
clearer if we rewrite the query to make the join conditions explicit:
: Re: help with SQL (join?) query
No offense but your response has created more confusion about this.. Here
is a more simple diagram for what I'd like to get from an SQL query:
Table users:
uid username
1 john
2 jim
3 mary
Table groups:
id name creator owner
1 test 1