Hi guys,

I need some help with this. I have the following 3 tables.

+------+-------+
| uid  | name  |
+------+-------+
|  100 | sue   |
|  102 | harry |
|  104 | louis |
|  107 | sam   |
|  110 | james |
|  111 | mark  |
|  112 | rita  |
+------+-------+

+------+-----------+
| gid  | name      |
+------+-----------+
|  501 | authors   |
|  502 | actors    |
|  503 | musicians |
|  504 | chefs     |
+------+-----------+

+------+------+
| uid  | gid  |
+------+------+
|   11 |  502 |
|  107 |  502 |
|  100 |  503 |
|  110 |  501 |
|  112 |  501 |
|  100 |  501 |
|  102 |  501 |
|  104 |  502 |
|  100 |  502 |
+------+------+

I'm looking for the following output:

1. Group members

group name      users
authors sue,harry,james,mark
actors          ...,
musicians       ...,
chefs           NULL

2. User memberships

user name       groups
user1           group1,group3, etc
user 2          group2, group3, etc
and so on

Any idea how to do this? 

TIA,

Vikram


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to