Pollos - 1:40 pm on Nov 14, 2011 (gmt 0)
I have two tables, called 2011 and 2012 both are set up the same I.E.
ID -- date -- cost
Each table has:-
ID = 1 to 365,
date 01/01/year to 31/12/year [in PHP strtotime format]
cost has the 'cost' [int]
Is it possible to select all the 'costs' between two dates where the dates span the two tables.
Example SELECT cost FROM table2011, table2012 WHERE date is BETWEEN 20/12/2011 and 10/01/2012 [dates in strtotime format]
I would need the 'costs' from the last X number of records from the 2011 table and the first X number of records from the 2012 table.
Is this possible? do I use one of the JOINS, which I'm reading up on but a little confused so far.
I'm using Mysql 5
Any help appreciated thanks.