Edit: Problem solved,
I just needed to add another and condition on .gId = .gu_gId
I was too quick to ask for help...again.
I am sorry to bother you guys.
I know I have read somewhere on this site how to accomplish aproximately what I want but I can't find it again.
So here it goes:
I have the following tables:
mysql> select * from Groups;
+-----+----------+----------+----------+-------+
| gId | gName | gFile | gTextTag | gVisi |
+-----+----------+----------+----------+-------+
| 1 | fishing | fishing | fishing | PUB |
| 2 | photo | photo | photo | PUB |
| 3 | cycle | cycle | cycle | PUB |
| 4 | travel | travel | travel | PUB |
| 5 | salsa | salsa | salsa | PUB |
| 6 | scc | scc | scc | PRI |
| 7 | salseras | salseras | salseras | PRI |
+-----+----------+----------+----------+-------+
mysql> select * from GUserList;
+--------+--------+
| gu_gId | gu_uId |
+--------+--------+
| 1 | 1 |
| 6 | 1 |
| 5 | 1 |
| 5 | 2 |
| 6 | 2 |
| 7 | 2 |
+--------+--------+
And I want the Result:
+----------+----------+
| gName | gTextTag |
+----------+----------+
| scc | scc |
| salseras | salseras |
+----------+----------+
But I get this:
mysql> select gName,gTextTag from Groups natural left join GUserList where GUserList.gu_uId=2 and Groups.gVisi='PRI';
+----------+----------+
| gName | gTextTag |
+----------+----------+
| scc | scc |
| scc | scc |
| scc | scc |
| salseras | salseras |
| salseras | salseras |
| salseras | salseras |
+----------+----------+
Explanation to the above mess is that the GUserList just is a collection of which Group, field:gu_gId a User, field gu_gId belongs to.
And from the table Groups I want to select those records(gName and gTextTag) with field:gVisi set to 'PRI' and where the user with gu_uId=2 is a member.
I would be very thankful for any help.
Thanx for reading.