As can be seen below, the last query fail, despite the one before it
succeeding.
Yet the second argument is constant, thus it would seem "natural" for it to
work as well.
Could the error be "relaxed", when the non-first argument(s) to aggregate
functions are constant?

Thanks, --DD

C:\Users\ddevienne>sqlite3
SQLite version 3.28.0 2019-04-16 19:49:53
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table t (id int);
sqlite> insert into t values (1), (2), (4), (2), (1), (7);
sqlite> select count(distinct id) from t;
4
sqlite> select group_concat(distinct id) from t;
1,2,4,7
sqlite> select group_concat(distinct id, ', ') from t;
Error: DISTINCT aggregates must have exactly one argument
sqlite>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to