I need to pull info from 2 tables and then do a summation on one of the returned rows. Here is the SELECT statement I have which does pull the info I need:
How can I do a SUM on the orders_total.value column? I thought I could do this using CREATE VIEW but then realized that you must have MySQL v5 to use CREATE VIEW.
Thanks in advance for any help.
Code:
SELECT orders.orders_id, orders.date_purchased, orders_total.class, orders_total.orders_id, orders_total.value
FROM orders, orders_total
WHERE orders.orders_id = orders_total.orders_id AND orders_total.class = 'ot_total' AND orders.date_purchased
LIKE '2004-07%'
Thanks in advance for any help.