here's my sql statement
SELECT ut.*, GROUP_CONCAT(ut.bet_group_id)
FROM users_transaction AS ut
WHERE ut.user_id = 3
GROUP BY ut.user_id
ORDER BY ut.id DESC;
my is goal is to group_concat
the bet_group_id
by user_id
, but when i execute my query above, i get this following error Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'p2p_trade.ut.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
and here's my sample table
id user_id bet_group_id
1 3 2
2 3 1
3 3 2
4 3 null
expected output will be
id user_id bet_group_id type_id
1 3 2,2
2 3 1
4 3 null