所以我有两个这样的表,第一个表()和第二个表()
*
那么,有可能这样做吗?
答案 0 :(得分:2)
您的FROM
表格列表和JOINs
必须位于查询的WHERE
子句之前。
我不知道查询的其余部分是否正确,但这是正确的顺序:
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
清理:
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