Ver Mensaje Individual
  #6 (permalink)  
Antiguo 02/09/2008, 15:37
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 1 mes
Puntos: 300
Respuesta: Qué hay mal en este Select?

Prueba esta y me dices...
Cita:
SELECT f.id, art, img
FROM fotos f
INNER JOIN (

SELECT id
FROM fotos
ORDER BY rand( )
)t1 ON f.id = t1.id
GROUP BY art
ORDER BY rand( )
LIMIT 10
Primero ordeno al azar los registros; luego relaciono esos registros con esos id agrupando por art(para que no se repita el art) y ordenando al azar y eligiendo los 10 primeros. No estoy seguro, pero haz pruebas con tus registros...