Cartesian Join Anyone ???
Rearrange Query as a UNION instead

----- Original Message -----
From: spacemarc <[EMAIL PROTECTED]>
To: mysql@lists.mysql.com
Sent: Wednesday, October 18, 2006 3:46:04 PM GMT-0500 US/Eastern
Subject: Simple JOIN on three tables

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

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to