I'm not used to the 'as' keyword and I thought it would be a nice idea to use it. So why do I get an 'unknown column' (eid) error? I use mysql...
select t1.index as eid, t1.col1 as col1, t1.col2 as col2,
t2.index, t2.col1, t2.col2,
t3.index, t3.col1, t3.col2
from table1 t1
left join table2 t2 on t2.index=eid
left join table3 t3 on t3.index=eid;
The full statement is too long to present here without boring everybody. The column and table names are random.