Ver Mensaje Individual
Antiguo 03-may-2008, 00:09   #2 (permalink)
jurena
jurena tiene algunos puntos positivos de karma
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 977
Re: con UNION ALL

Si lo que quieres es unir las 12 tablas y que, tras ordenar de manera descendente por los campos fecha y hora, te muestre sólo los 20 primeros, puedes hacer esto.

(SELECT fecha AS C1, hora AS C2 FROM tabla1)
UNION ALL
(SELECT FROM fecha, hora FROM tabla2)
UNION ALL
(SELECT FROM fecha, hora FROM tabla3)
UNION ALL
(SELECT FROM fecha, hora FROM tabla4)
//... hasta la tabla12

ORDER BY C1 DESC, C2 DESC LIMIT 20
jurena está desconectado   Responder Citando