So I have tw开发者_高级运维o tables like this, first table () and second table ()
*
So, it's possible to do this?
Your FROM
table list and JOINs
must come before the WHERE
clause of the query.
I don't know if the rest of the query was right, but this is it in the right order:
SELECT id_maestro, nombre, materia
FROM maestros_detalle AS t1
LEFT JOIN (SELECT id, up, down FROM maestros) AS t2 ON t1.id_maestro = t2.id
WHERE MATCH (t1.nombre, t1.materia)
AGAINST ('quimica' IN BOOLEAN MODE)
ORDER BY t1.id_maestro
Cleaned up:
SELECT
t1.id_maestro,
t1.nombre,
t1.materia,
t2.up,
t2.down
FROM
maestros_detalle t1
LEFT JOIN
maestros t2
ON
t1.id_maestro = t2.id
WHERE
MATCH(t1.nombre, t1.materia) AGAINST ('quimica' IN BOOLEAN MODE)
ORDER BY
t1.id_maestro
精彩评论