On 1/6/2011 5:54 PM, gasperhafner wrote: > Igor Tandetnik wrote: >> >> 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 > > This doesn't work... > > I want ID_dishes order by count of ingredient which i have the most,
What do you mean, have the most? I don't understand the problem statement. An example, perhaps? -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users