Don't you use the following statements instead of yours? ...month between 10 and 12
On Wed, May 7, 2008 at 1:46 AM, kabel <[EMAIL PROTECTED]> wrote: > > I have a table from which I need to calculate the percentage growth of > downloads from specific countries over two distinct periods of time. > Calculating the total downloads from a country over one period of time is > not > difficult: > > SELECT country, SUM(total_dl) AS q3_total FROM show_history WHERE year = > 2007 > AND ( month = 12 OR month = 11 OR month = 10 ) GROUP BY (country); > > I need to be able to compare those numbers with the result of: > > SELECT country, SUM(total_dl) AS q4_total FROM show_history WHERE year = > 2007 > AND ( month = 10 OR month = 11 OR month = 12 ) GROUP BY (country); > > I'm currently using temporary tables to store the results of each query, > however, I think there's a way to accomplish this using subqueries. > > Any thoughts? > > TIA, > > kabel > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > -- I'm a mysql DBA in china. More about me just visit here: http://yueliangdao0608.cublog.cn