Implement selecting groupы of user from db, and save this data into db