SELECT distinct anuncio.id, anuncio.id id_anuncio, (MATCH (anuncio.busca, anuncio.empresa, anuncio.telefone) AGAINST ('hobbies e lazer' in boolean mode) * 3) + (MATCH (anuncio.email, ramo.ramo) AGAINST ('hobbies e lazer' in boolean mode) * 2 ) + (MATCH (anuncio.descricao, anuncio.endereco, anuncio.palavras_extras) AGAINST ('hobbies e lazer' in boolean mode) * 1 ) AS rank FROM anuncio INNER JOIN ramo_anuncio ON anuncio.id = ramo_anuncio.id_anuncio INNER JOIN ramo ON ramo_anuncio.id_ramo = ramo.id WHERE MATCH (anuncio.busca, anuncio.empresa, anuncio.telefone, anuncio.email, ramo.ramo, anuncio.descricao, anuncio.endereco, anuncio.palavras_extras) AGAINST ('hobbies e lazer' in boolean mode) ORDER BY rank DESC, anuncio.nivel DESC [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank FROM anuncio INNER JOIN ramo_anuncio ON anuncio.id = ramo_anuncio' at line 7]SELECT::anuncio