SELECT user_matches.* FROM users u JOIN user_matches ON u.id = user_matches.user_id AND FIND_IN_SET( user_matches.to_user_id, ( SELECT GROUP_CONCAT(users.id) FROM `users` ) );
Advertisement
Answer
Do it with
IlluminateSupportFacadesDB::select('')
to write you raw query .