List:General Discussion« Previous MessageNext Message »
From:Roger Baklund Date:July 29 2003 9:03pm
Subject:Re: Left Join multiple tables
View as plain text  
* Petre Agenbag 
> 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..
> 
> main
> id	entity_name	...
> 
> fof
> id_fof	id	information_sent ...
> 
> pub
> id_pub	id	information_sent ...
> 
> etc.
> 
> So, I tried the following join 	
> 
> select * from main 

You need to name all fields, and use aliases to rename the colliding names:

  select main.*,fof.id fof_id,fof.information_sent fof_info_sent,
                pub.id pub_id,pub.information_sent pub_info_sent,

...and so on.

<URL: http://www.mysql.com/doc/en/SELECT.html >

-- 
Roger
Thread
Left Join multiple tablesPetre Agenbag29 Jul
  • Re: Left Join multiple tablesRoger Baklund29 Jul
Re: Left Join multiple tablesBill Easton30 Jul