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
> 
> -- 
> Igor Tandetnik
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

This doesn't work...

I want ID_dishes order by count of ingredient which i have the most,
i try this in sqlitemanger but it didn't return me right order
-- 
View this message in context: 
http://old.nabble.com/help-with-optimazing-sql-query-tp30608918p30609897.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to