vendredi 17 juillet 2015

SQLite Concatenating Column values

There are similar answers for other database types but I haven't found an example for this for SQLite, so I've included the answer that I came up with.

The Problem

Given a table like the following

Item    Tag
"Item1" "A"
"Item1" "B"
"Item1" "C"
"Item2" "A"
"Item1" "D"
"Item2" "F"
"Item1" "E"

Create an output of:

Item    Tags
"Item1" "A,B,C,D,E"
"Item2" "A,F"

Aucun commentaire:

Enregistrer un commentaire