This is my db "users":
----------------------

```

user    group   show_groupmembers
----------------------------------
Bob     Alpha   Y
Peter   Alpha   N
Peter   Beta    Y
Chris   Beta    Y

```

If show\_groupmembers is "Y", the user can see the all other members of his group.
(So Bob for example can see all "Alpha"-Group users)

If show\_groupmembers is "N", the user can't see any members of his group 
(So Peter for example can't see any "Alpha"-Group users)

And here is what I wanna do:
----------------------------

I have a current\_user, Peter and want to check if Peter can see Bob.
So it must be checked that 

1. there are in the same group and
2. the flag "show\_groupmembers" of the urrent\_user (Peter) is 'Y'.

If this check fails (like in my example), the "EXIST SELECT 1" should
return nothing of course, else it should return something.

I've seen solutions that work, but only if the current\_user is only member of one group. As soon as he is more groups, the check above seems not to work.

Any Ideas how to perform this? I am totally stuck with that.