title: Unknown Column Left Join MySQL
body: <p>I've used the "NOT IN (select)" Function, but it takes too long to load on several registers. So I want to improve the query using LEFT JOIN, but I don't know what's wrong. I'm getting <code>#1054 - Unknown column 'a.id_logistica' in 'on clause'</code>.
  The column "id_logistica" in table "logistica" does exists, as it does in "det_log" table. This is the code:</p>
  
  <pre><code>SELECT 
    a.*, a.id_logistica, 
    b.nombre username, c.placa, 
    b.nombre scliente, e.nombre ruta,
    d.nombre_con, clase 
  FROM 
    logistica a,  cliente b,
    vehiculo c,  conductores d, ruta e 
  LEFT OUTER JOIN 
    det_log t2 ON  t2.id_logistica = a.id_logistica
  WHERE 
    a.id_cliente = b.id_cliente  AND  a.id_ruta = e.id_ruta 
    AND t2.id_logistica IS NULL AND a.id_vehiculo = c.id_vehiculo 
    AND a.id_conductor = d.id_conductor AND activo = 1 
    and finalizado = 0  AND ( a.id_ruta &gt; 1 OR a.borrado = 9 ) 
  ORDER BY 
    fecha_des DESC
  </code></pre>