John Found wrote: > i.e. how to select only the groups that contain > some value in the set of values in a column not > specified in group by clause. > > select > (select group_concat(b) from t t1 where t1.a = t2.a) as list > from t t2 > where b = ?1;
Similarly: select group_concat(b) as list from t where a in (select a from t where b = ?1) group by a; But you will not be able to avoid the subquery: the filter has to include all other rows of the group with matching b, and after the group_concat(), the result is no longer in a form useful for lookups. (And doing the filter after the grouping is probably not efficient.) Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users