I have a data set like this:
Column1 Column2 1 A 1 B 1 C 2 D 2 E 2 F 2 G 3 H 3 I
and I would like to merge it into something like this:
Column1 Column2 1 A, B, C 2 D, E, F, G 3 H, I
Is it possible to do this in SQLite somehow? I though of GROUP BY Column1, but I don't see how I can combine the Column2 data in one string...
Thanks!
Select the range of cells where you want to merge rows. Go to the Ablebits Data tab > Merge group, click the Merge Cells arrow, and then click Merge Rows into One.
You concatenate strings by using the + operator. For string literals and string constants, concatenation occurs at compile time; no run-time concatenation occurs. For string variables, concatenation occurs only at run time.
SELECT Column1, group_concat(Column2) FROM Table GROUP BY Column1
group_concat takes an optional second argument (a string) to use as the concatenation separator if you don't want a single ',' character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With