I have a query like this:

SELECT
lpt_titulo AS tmt_titulo,
tmd_nombre AS tmt_nombre,
tmd_album AS tmt_album
SUM(lpt_puntos) AS tmt_puntos,
lpt_fuente AS tmt_fuente
FROM listas_pre_titulos, temp_lista_titulos
WHERE
listas_pre_titulos.lpt_tipo = 3 AND
listas_pre_titulos.lpt_titulo <> temp_lista_titulos.tmt_titulo AND
listas_pre_titulos.tmd_album <> temp_lista_titulos.tmt_album AND
listas_pre_titulos.lpt_fuente <> temp_lista_titulos.tmt_fuente
GROUP BY
lpt_fuente, lpt_titulo, tmd_album
ORDER BY tmt_puntos ASC

Is it valid to re-write the FROM and WHERE statements as follows?

FROM listas_pre_titulos
INNER JOIN temp_lista_titulos ON
(listas_pre_titulos.lpt_titulo, listas_pre_titulos.tmd_album,
listas_pre_titulos.lpt_fuente)
NOT IN
(temp_lista_titulos.tmt_titulo, temp_lista_titulos.tmt_album,
temp_lista_titulos.tmt_fuente)
WHERE listas_pre_titulos.lpt_tipo = 3

With respect,
Jorge Maldonado

Reply via email to