开发者

Match Against and left join shows error

开发者 https://www.devze.com 2023-02-06 21:24 出处:网络
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.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消