I have 4 tables, in this all tables have 3 rows[record] and 3 column[field] field like Date Name Total. This table like below:
First Table
Date Name Total
2012-11-07 Manoj 10
2012-11-08 Ganesh 4
2012-11-09 Sri 30
Second Table
Date Name Total
2012-11-07 Raju 5
2012-11-08 ggg 3
2012-11-09 Shshi 30
Third Table
Date Name Total
2012-11-07 Ram 2
2012-11-08 gm 5
2012-11-09 Shsse 30
I need Output Like following type in PHP
Date Total
2012-11-07 17
2012-11-08 12
2012-11-09 90
It should display all total in between date in PHP
You can use a
UNION ALL
:See SQL Fiddle with Demo
Or you might be able to use a
LEFT JOIN
similar to this:See SQL Fiddle with Demo