I has a problem:
In my SQLite (sqlite3 on android) database I have a table like so
company | name | job -------------------------- 1 | \'Peter
You were close!
SELECT company, group_concat(concat) AS formated FROM ( SELECT company, CASE WHEN job IS NULL THEN name ELSE name || ' (' || job || ')' END AS concat FROM jobs ) GROUP BY company