On Sat, Jan 10, 2015 at 5:56 PM, Staffan Tylen <staffan.ty...@gmail.com> wrote:
> Thanks Richard but unfortunately I cannot use DISTINCT in that way, since > it affects all the selected columns and they are MANY. > > Staffan > I am having trouble visualizing what your actual SELECT is. Would you mind posting it? > > > On Sun, Jan 11, 2015 at 12:43 AM, Richard Hipp <d...@sqlite.org> wrote: > > > On 1/10/15, Staffan Tylen <staffan.ty...@gmail.com> wrote: > > > I'm in the situation where I need to use GROUP_CONCAT and filter out > > > duplicates at the same time. And the default comma separator in > > > GROUP_CONCAT needs to be replaced by a space. I've tried to use > function > > > REPLACE to get rid of the comma but only to realise that the data being > > > concatenated also might contain one or more commas. > > > > > > > SELECT group_concat(x,'+') FROM (SELECT DISTINCT a+b AS x FROM tab ORDER > > BY 1); > > > > > > -- > > D. Richard Hipp > > d...@sqlite.org > > _______________________________________________ > > 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 > -- While a transcendent vocabulary is laudable, one must be eternally careful so that the calculated objective of communication does not become ensconced in obscurity. In other words, eschew obfuscation. 111,111,111 x 111,111,111 = 12,345,678,987,654,321 Maranatha! <>< John McKown _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users