| List: | General Discussion | « Previous MessageNext Message » | |
| From: | spacemarc | Date: | October 18 2006 7:46pm |
| Subject: | Simple JOIN on three tables | ||
| View as plain text | |||
Hi
I have 3 tables with the same fields.
I would want to find the data that they are comprised in the time interval:
SELECT a.*, b.*, c.*
FROM tab1 a, tab2 b, tab3 c
WHERE a.date between 'YYYY-MM-DD' and 'YYYY-MM-DD'
OR b.date between 'YYYY-MM-DD' and 'YYYY-MM-DD'
OR c.date between 'YYYY-MM-DD' and 'YYYY-MM-DD'
ORDER BY a.date DESC
But this query returns all the fields duplicated.
Where it is mistaken?
--
http://www.spacemarc.it
| Thread | ||
|---|---|---|
| • Simple JOIN on three tables | spacemarc | 18 Oct |
| • Re: Simple JOIN on three tables | William R. Mussatto | 18 Oct |
| • Re: Simple JOIN on three tables | Rolando Edwards | 18 Oct |
| • Re: Simple JOIN on three tables | spacemarc | 18 Oct |
| • Re: Simple JOIN on three tables | Peter Brawley | 18 Oct |
| • Re: Simple JOIN on three tables | spacemarc | 18 Oct |
| • Re: Simple JOIN on three tables | William R. Mussatto | 18 Oct |
| • Re: Simple JOIN on three tables | spacemarc | 18 Oct |
| • Re: Simple JOIN on three tables | Peter Brawley | 18 Oct |
| • Re: Simple JOIN on three tables | William R. Mussatto | 18 Oct |
| • Re: Simple JOIN on three tables | Martijn Tonies | 19 Oct |
