David Bicking wrote: > The complication is that if a given key has any non-C value, the C values are > to be excluded.
First, just exclude all C values: ... WHERE Status <> 'C' ... > If there are only C values, they are to be included. Then do the same query again, but with the all-C keys: ... UNION ALL SELECT ... WHERE Key NOT IN (SELECT Key FROM T1 WHERE Status <> 'C') ... Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users