From: Dan Nelson Date: April 20 2006 4:41am Subject: Re: where group and inner join List-Archive: http://lists.mysql.com/mysql/197058 Message-Id: <20060420044154.GC28208@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Apr 19), Dan Nelson said: > It's useful to note that SELECT statements generally work in the > order they are written. The WHERE clause applies to the records as > they are read from the source tables, and at that point, no grouping > has been done, so there's no sum. Try moving your filter to a HAVING > clause, which comes between GROUP BY and HAVING, and applies to the "which comes between GROUP BY and ORDER BY", of course :) -- Dan Nelson dnelson@stripped