My query in MySQL uses group_concat to convert values in multiple rows into a single column.
SELECT
user_id,
group_concat(case when event = 'BORROWED' then book_id end
separator ' ') as borrowed_books
FROM library_events
The problem that I encounter is that the ad-hoc column borrowed_books into which the values are concatenated gets maxed out at 1026 characters. I have also seen that the string in the column gets truncated after 1026 characters.
How can I set/increase this value for the ad-hoc column?