Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/07/2010, 14:52
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años
Puntos: 300
Respuesta: obtener listado segun fk y fechas, limit 10

usa UNION ALL, tres consultas con su límite cada una
(SELECT a.id,title,catid,created,name FROM articulos a INNER JOIN categorias c ON catid = c.id WHERE c.published = 1 AND catid = 1 ORDER BY created DESC LIMIT 0,10)
UNION ALL
(SELECT a.id,title,catid,created,name FROM articulos a INNER JOIN categorias c ON catid = c.id WHERE c.published = 1 AND catid = 2 ORDER BY created DESC LIMIT 0,10)
UNION ALL
(SELECT a.id,title,catid,created,name FROM articulos a INNER JOIN categorias c ON catid = c.id WHERE c.published = 1 AND catid = 4 ORDER BY created DESC LIMIT 0,10)