The following code does not work, but gives an idea what I want to do:

    create table t (a, b);

    select 
      group_concat(b) as list 
    from t 
    group by a
    having ?1 in (list);

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.

The only way I was able to do it is by subquery.
Something like this:

    select 
      (select group_concat(b) from t t1 where t1.a = t2.a) as list
    from t t2
    where b = ?1;


-- 
John Found <johnfo...@asm32.info>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to