Ver originalSELECT noticias.titulo,noticias.noticia,noticias.categoria,foto.id_noticia,foto.foto FROM noticias n INNER JOIN fotos f ON n.id = f.id_noticias WHERE ID IN (SELECT MAX(id)FROM noticiasGROUP BY categoria)ORDER BY categoria;