I have the following MySQL tables:

```
USERS(uid,name)   USERS_GROUPS(u_id,r_id,flag)       REQUESTS(rid,status)
------------------------------------------------------------------------
1  John             1  96   1                       96    0
2  Peter            1  97   1                       97    0
3  Helen            2  97   0                       98    0 
                    3  97   0                       99    1 
                    2  98   1
                    1  98   0
                    3  98   0

```

Above, you may see some sample data. USERS to USERS\_GROUPS 1:N,REQUESTS to USERS\_GROUPS 1:N (u\_id, r\_id PKs and FKs). Every record in USERS\_GROUPS with the same r\_id is considered as belonging to the same group. 

I want to select those records from USERS\_GROUPS which are associated with a certain uid (e.g. 1) and a certain status (e.g. 0) only if the flag equals 1. However, in that case I'd like SELECT to contain all the records of its group. In other words, based on the sample data I want the following result:

```
1  96   1
1  97   1
2  97   0
3  97   0

```

Unfortunately, I cannot find the right query. I 'd appreciate your help.