I have problems understanding the correct syntax of sql using explicit joins. For example in the first snippet, in the second join "ec" is visible and the restriction works. But in the second snippet "op" cannot be resolved.
First snippet:
select im.*
from gestion_corte gc
join evento_corte ec
on ec.id_corte = gc.id_corte
join op_corte op
on op.id_corte = gc.id_corte
and op.fecha_evento = ec.fecha_evento
join img_corte im
on op.id_corte = im.id_corte
where ec.fecha_evento > '01092012'
Second snippet, "op" cannot be resolved in first join:
select im.*
from gestion_corte gc
join evento_corte ec
on ec.id_corte = gc.id_corte
and op.fecha_evento = ec.fecha_evento -- This condition has moved
join op_corte op
on op.id_corte = gc.id_corte
join img_corte im
on op.id_corte = im.id_corte
where ec.fecha_evento > '01092012'
In consequence, the visibility is resolved processing from top to bottom? are any other important thing to have in consideration?