How to aggregate results from SELECT JOIN
Try with this

SELECT
   u.id AS user_id,
   u.username AS username,
   GROUP_CONCAT(usp.id) AS subscription_ids -- Array of ids for each user
   FROM user AS u
INNER JOIN user_subscription_plan usp on usp.id = u.id
GROUP BY u.id,u.username;


https://www.w3resource.com/mysql/aggregate-functions-and-grouping/aggregate-functions-and-grouping-group_concat.php#SP