SQLite LISTAGG function

Kintara

Member
Licensed User
Longtime User
Hi,
I have recently moved over to using SQLite and find it very good to manipulte data. One function I am having trouble with is using the LISTAGG function.
This is what it does in Oracle
name type
------------
name1 type1
name2 type2
name2 type3

SELECT name, LISTAGG(type, '; ') FROM table GROUP BY name ORDER BY name

Would result in:

name type
------------
name1 type1
name2 type2; type3


Is there a similar funtion in the SQLite library that I could use?

Kintara :cool:

p.s. I am using SQLDesktop.dll 1.51
 
Last edited:

Basic4Life

Member
Licensed User
For your example, this command should work:

SELECT name, GROUP_CONCAT(type,'; ') AS type FROM table GROUP BY name ORDER BY name
 

Kintara

Member
Licensed User
Longtime User
Thank you very much, that was quick and more importantly it worked a treat!

Just out of interest, where do you look to find the B4PPC SQL commands available? I was looking in the SQLite site but the commands are a slightly different flavour.

Kintara :cool:
:sign0060:
:sign0098:
 
Top