The problem is that your table design is flawed: you have stored multiple values in a column, separated by commas. This is a problem, as SQL is not good at "deCSVing" data.
Create a new table which contains the Groups:
ID GroupName
1 Group1
2 Group2
3 Group3
...
Change your UserMaster table to store multiple Group entries for each user, referenced by the GroupID as a foreign key:
Username Group
user1 1
user1 2
user1 3
user2 2
user2 4
user3 5
(Better still, have a table with UserID and UserName and reference that throughout all your tables as a foreign key.)
You then just fetch your data using IN and JOIN statements.
It seems like a lot of extra work, but it really isn't that difficult, and it saves you huge amounts of time, effort, and redundantly duplicated data later.