On Fri, 12 Oct 2018 11:12:17 +0200 Clemens Ladisch <[email protected]> wrote:
> I wrote: > > But you need to find some aggregate function that can do the filtering. > > HAVING SUM(b = ?1) > > (In a database with proper booleans: "HAVING SUM(CASE WHEN b = ? THEN 1 END) > > 0") Hey, this really looks great. Thanks. Also, it seems max(b = ?1) will do the trick as well as count(b = ?1) And here another question appears. What is more efficient? At first glance, max() looks better, because it does not need to scan all values from the group. But is it the case in SQLite implementation? > > > Regards, > Clemens > _______________________________________________ > sqlite-users mailing list > [email protected] > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users -- John Found <[email protected]> _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

