Thanks Richard That helps but it seems I over simplified in order to get the help I thought I needed :)
My actual query follows a MFT entry from an NTFS file system as such WITH RECURSIVE rcte AS (SELECT rtable.ID, rtable.parent, rtable.FileName FROM rtable WHERE rtable.ID = 510 UNION ALL SELECT rtable.ID, rtable.parent, rtable.FileName FROM rcte INNER JOIN rtable ON rcte.parent = rtable.ID WHERE rtable.FileName <> '.' LIMIT 20) SELECT Group_Concat(rcte.FileName, '\') AS col1 FROM rcte ORDER BY rcte.ID This however appends the path in the wrong order, i.e. I get the file name first and the root folder last Changing the sort order on the ORDE BY to DESC when using group_Concat has no affect but when the Group-Concat is ommitted I get the correct ordering. I understand why, but I can't see how I can get the sort applied before the Group_Concat is called - I think this might be what John is referring to. Thanks Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit -Forensic Toolkit for SQLite http://sandersonforensics.com/forum/content.php?168-Reconnoitre - VSC processing made easy On 2 December 2014 at 18:27, John McKown <john.archie.mck...@gmail.com> wrote: > On Tue, Dec 2, 2014 at 11:51 AM, Richard Hipp <d...@sqlite.org> wrote: > >> On Tue, Dec 2, 2014 at 12:46 PM, Paul Sanderson < >> sandersonforens...@gmail.com> wrote: >> >> > I have a query that returns one column but a number of rows so for >> instance >> > >> > SELECT name from tab >> > >> > might return >> > >> > a >> > b >> > c >> > d >> > >> > I would like to append these terms and get a single line/string >> > >> > a_b_c_d >> > >> > >> > I want to just use a single SQL query to do this, is it possible? >> > >> >> SELECT group_concat(name,'_') FROM tab; >> > > Just a bit curious, but is there a way to ensure a particular order on the > "name" column values? I.e. isn't it possible that the result might be > a_d_b_c under some circumstance? > > > >> >> -- >> D. Richard Hipp >> d...@sqlite.org >> >> > > -- > The temperature of the aqueous content of an unremittingly ogled > culinary vessel will not achieve 100 degrees on the Celsius scale. > > Maranatha! <>< > John McKown > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users