On 1/6/2011 5:25 PM, gasperhafner wrote: > Igor Tandetnik wrote: >> >> select ID_DISH, sum(ID_INGREDIENT not in (2, 4)) stillMissing >> from x >> group by ID_DISH >> having stillMissing != count(*) >> order by stillMissing; > > What about if a want sort by ingredients asc which i have?
order by count(*) - stillMissing -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users