Ver Mensaje Individual
  #10 (permalink)  
Antiguo 26/05/2011, 18:33
Avatar de gnzsoloyo
gnzsoloyo
Moderador criollo
 
Fecha de Ingreso: noviembre-2007
Ubicación: Actualmente en Buenos Aires (el enemigo ancestral)
Mensajes: 23.324
Antigüedad: 16 años, 5 meses
Puntos: 2658
Respuesta: Problema consulta

Tal vez algo así:
Código MySQL:
Ver original
  1.     id_noticia,
  2.     titulo,
  3.     noticia,
  4.     categoria,
  5.     foto
  6.     (SELECT
  7.         n.titulo,
  8.         n.noticia,
  9.         n.categoria,
  10.         f.id_noticia,
  11.         f.foto
  12.     FROM noticias n INNER JOIN fotos f ON n.id = f.id_noticias
  13.     ORDER BY n.categoria ASC, n.id DESC) T1
  14. GROUP BY categoria;
__________________
¿A quién le enseñan sus aciertos?, si yo aprendo de mis errores constantemente...
"El problema es la interfase silla-teclado." (Gillermo Luque)