By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,403 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,403 IT Pros & Developers. It's quick & easy.

Left Join multiple tables

P: n/a
Hi List
Me again.

I'm trying to return from multiple tables, the records that have field
"information_sent" between two dates.
The tables are all related by means of the id of the entry in the main
table, ie..

id entity_name ...

id_fof id information_sent ...

id_pub id information_sent ...


So, I tried the following join

select * from main
left join fof on =
left join pub on =
left join gov on =
left join med on =
left join ngo on =
left join own on =
left join sup on =
left join tra on =
where (
(fof.information_sent > '$date1' and fof.information_sent < '$date2')
(pub.information_sent > '$date1' and pub.information_sent < '$date2')
(gov.information_sent > '$date1' and gov.information_sent < '$date2')
(med.information_sent > '$date1' and med.information_sent < '$date2')
(ngo.information_sent > '$date1' and ngo.information_sent < '$date2')
(own.information_sent > '$date1' and own.information_sent < '$date2')
(sup.information_sent > '$date1' and sup.information_sent < '$date2')
(tra.information_sent > '$date1' and tra.information_sent < '$date2')
order by entity_name
BUT, although it seems to be "joining" the tables correctly AND only
returning the ones with the correct date criteria, it does NOT return
the "id" or the "information_sent" fields correctly ( due to duplication
in the result )

What am I doing wrong?

mysql, query

MySQL General Mailing List
For list archives:
To unsubscribe:***********

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.