From: Peter Brawley Date: October 18 2006 8:51pm Subject: Re: Simple JOIN on three tables List-Archive: http://lists.mysql.com/mysql/202778 Message-Id: <453693E8.7070006@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >I simply want to select the records from my three tables that are >comprised in time interval. If you want the results in one resultset, apply an appropriate Where clause to each year-table query and union the queries, eg SELECT * FROM a WHERE date BETWEEN '2004-3-1' AND '2004-6-30' UNION SELECT * FROM b WHERE date BETWEEN '2005-3-1' AND '2005-6-30' etc PB ----- spacemarc wrote: > 2006/10/18, Peter Brawley : > >> You can join on any row(s) you like. What are you trying to acccomplish? > > I simply want to select the records from my three tables that are > comprised in time interval. > Now, the first table comprises the records until to 2004 year; the > second table unitl 2005 and the third table until 2006. > > If a user select a date (example) between 2005 and 2006 I want to > select the data from two tables.... > -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.5/483 - Release Date: 10/18/2006