[PHP-DB] Re: RE:[PHP-DB] How do I do math with a UNION ALL

2011-04-16 Thread Ron Piggott
Thank you for the suggestion. This is the actual query that I implemented: Amazing how this works. Ron SELECT SUM( `impressions_total` ) AS impressions_total , SUM( `usage_total` ) AS usage_total FROM ( ( SELECT IF ( SUM( `web_advertisements_our_clients_usage`.`

[PHP-DB] How do I do math with a UNION ALL

2011-04-16 Thread Ron Piggott
Hi Everyone. I am trying to do a SUM of the "impressions" and "usage" columns from 2 different tables using a UNION ALL. I have tested that the individual SELECT queries work. I am unsure of the layout for the UNION ALL. Would you help me tweak this query? I also wanted to ask is "usage"