On Saturday, January 27, 2007, 10:10:27 PM, Igor Tandetnik<sqlite-users@sqlite.org> wrote: > [EMAIL PROTECTED] wrote: >> Actually, my query is something like >> SELECT ... FROM ... WHERE `pid` = (SELECT `id` FROM ...); >> if i put that group by... will it group all rows, or only those with >> the same pid?
> GROUP BY works on whatever rows remain after WHERE test. > Igor Tandetnik > ----------------------------------------------------------------------------- > To unsubscribe, send email to [EMAIL PROTECTED] > ----------------------------------------------------------------------------- So I could just use SELECT ..., SUM(`downloadCount`) FROM ... WHERE `pid` = (SELECT `id` FROM ...) GROUP BY `price`; Is that going to do the same as SELECT SUM(`downloadCount` FROM (SELECT ... FROM ... WHERE `pid` = (SELECT ...)) GROUP BY `price`; ? Best Regards, Ivailo Karamanolev ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------