ok, i have to get two mysql tables to work as one. one is called sale_mast_data and the other is called sale_mast_data_h. they both have the same columns. the only difference is that the one with the "_h" has the history of previous shift sales. the two tables both contain sales and i want to take a look at what has been sold in total, not just what has been sold in the current shift or the old shifts.
i have tried various things like
SELECT * FROM Sale_Mast_Data_H S1, Sale_Mast_Data S2 GROUP BY S1.PluCode, S2.PluCode
but that joins the tables so that all the columns are duplicated.
SELECT S1.Description, S2.Description, SUM(S1.Quantity, S2.Quantity) FROM Sale_Mast_Data_H S1, Sale_Mast_Data S2 GROUP BY S1.PluCode, S2.PluCode
but this just tells me i have problem around the "SUM(S1... " area.
the only other thing i can think of doing is getting two ResultSets and then putting all the data into an array and then comparing the data in the arrays and adding the figures together that need to be added.
*headache*
is there an easy way?