Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/12/2011, 13:24
Avatar de lohenzoo
lohenzoo
 
Fecha de Ingreso: septiembre-2011
Ubicación: Ciudad Juarez, Chihuahua
Mensajes: 26
Antigüedad: 12 años, 7 meses
Puntos: 5
problema con subqueries en MySQL

Necesito ayuda para saber porque este query no me arroja ningun resultado y no marca error, o de que manera puedo hacer esto de alguna otra forma.

Lo que intento hacer es traer 3 filas de diferentes secciones. Tengo 29 secciones y requiero traer solo los 3 registros mas recientes de diferentes secciones.

Espero explicarme.

Código PHP:
SELECT t1.headline,t1.images,t1.published,t2.headline,t2.images,t2.published,t3.headline,t3.images,t3.published,t4.headline,t4.images,t4.published,t5.headline,t5.images,t5.published FROM  
(SELECT headline,images,published from articles_norte 
WHERE published 
'2011-12-14 04:30:38' 
AND sectionId between "1" and "8" 
ORDER BY published desc limit 3) as t1,                 
(
SELECT headline,images,published from articles_norte 
WHERE published 
'2011-12-14 04:30:38' 
AND sectionId between "15" and "17" 
ORDER BY published desc limit 3) as t2
(
SELECT headline,images,published from articles_norte 
WHERE published 
'2011-12-14 04:30:38' 
AND sectionId "26" order by published desc limit 3) as t3
(
SELECT headline,images,published from articles_norte 
WHERE published 
'2011-12-14 04:30:38' and sectionId "27" 
ORDER BY published desc limit 3) as t4
(
SELECT title as headline,image as images,publishedDate as published from gallery_v1 WHERE publishedDate '2011-12-14' 
ORDER BY publishedDate desc limit 3) as t5