I have 12 tables, one for each month. Each table has the same structure just a different name. What would be the best way to join these to select all data (in this case where w has a value) to show ordered by date.
I also need to select a name from a user table that matches the userid stored in the monthly table.
This is what I use if just selecting from the one table.
SELECT name,`thedate`,`vmtd`,`w`, `c`FROM `2013_ws_January` j, tbl_users u where uid=u.id and `w` !='' order by uid, `thedate`;
Each table for the monthly data is made up of `id`,`uid`,`thedate`,`vmtd
Tables name example 2013_ws_January, 2013_ws_February etc.
Thanks for reading.