Say I have a database table `user_provider`, that contains many to many relationship of `user` and `provider` table.  

I want to get only those `userId` which is having only one provider

```
 SELECT spr1.SU_URS_ID,count(spr1.SU_URS_ID)
 FROM overstappen.spr_usr spr1 
 WHERE spr1.SU_URS_ID in ( select spr.SU_URS_ID 
                           from overstappen.spr_usr spr 
                           where spr.SU_SPR_ID =40) 
 GROUP BY spr1.SU_URS_ID; 

```

Above query returns all users which is having `SU_SPR_ID 40`. And the total no of users with same userId in spr\_usr table.

I only want to get user with `count 1`. i.e user with only one provider.

Thanks in advance.