On 1/12/15, Staffan Tylen <staffan.ty...@gmail.com> wrote: > Thanks Clemens. I notice however that nobody has attempted to respond to my > original questions. I'm mostly interested in why the documentation states > that DISTINCT can only be used with aggregate functions taking a single > argument, which in fact is only one, namely GROUP_CONCAT. For a person like > me with no knowledge of the internals of SQLite it's somewhat puzzling that > GROUP_CONCAT(DISTINCT ABC) is valid but GROUP_CONCAT(DISCRETE ABC,' ') is > not. The internal logic must/should IMHO be identical in both cases. It > doesn't make sense to me. Anyone? >
DISTINCT is restricted to single-argument aggregates because I do not know what to do (in general) for broader cases. Certainly the group_concat() case you site, with a constant second term makes sense. But any code I write needs to work *in general*, and not for just that one special case. So if you say "group_concat(DISTINCT x,y)" does that mean that the combination of x and y must be distinct or that only x is distinct? Are we allowed to say "group_concat(x, DISTINCT y)" or "group_concat(DISTINCT x, DISTINCT y)". And what does the latter mean, exactly? Are there any other SQL database engines that allow multi-argument aggregate functions? What do those systems do? -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users