On 12/13/17, Valentin Davydov <[email protected]> wrote: > Given the following table: > > CREATE TABLE people(name,sex); > INSERT INTO people VALUES("Alex","F"); > INSERT INTO people VALUES("Alex","M"); > INSERT INTO people VALUES("Jane","F"); > INSERT INTO people VALUES("John","M"); > > How to construct a query which returns coalesced sex but individual names, > such as "F: Alex, Jane. M: Alex, John."?
SELECT sex || ': ' || group_concat(name, ", ") FROM people GROUP BY sex; -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

