Ocorreu um erro de base de dados

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 7

SELECT DISTINCT n.*, nd.* FROM default_noticia as n LEFT JOIN default_noticia_descricao as nd ON(nd.id_noticia = n.id) INNER JOIN default_noticia_relacionada as nr ON(nr.id_relacionada = n.id) WHERE nr.id_noticia =