Can a user have the maximum of two wallets, or can a user have an more or less infinite number of wallets?
If it is a set number than it's doable with a single sql query, but if it is a dynamic number of wallets, it's not doable.
SELECT t1.user_id,
(SELECT t2.open FROM table t2 WHERE t2.user_id = t1.user_id ) walet_1_open,
(SELECT t2.close FROM table t2 WHERE t2.user_id = t1.user_id ) walet_1_close,
(SELECT t3.open FROM table t3 WHERE t3.user_id = t1.user_id ) walet_2_open,
(SELECT t3.close FROM table t3 WHERE t3.user_id = t1.user_id ) walet_2_close,
FROM table t1;
To make this dynamic, you need to build the SQL first depending on your data, and then execute it. It is possible to do, but it's not a good solution.