Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/09/2009, 00:49
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 10 meses
Puntos: 300
Respuesta: Ayuda SELECT.. LIKE

SELECT a.id, COUNT(DISTINCT c.tag) FROM imagenes AS a
inner JOIN imagenes_tags AS b ON a.id = b.img_id
inner JOIN indice_tags AS c ON b.tag_id = c.id
WHERE c.tag IN('árboles','hojas','rojas')
GROUP BY b.img_id HAVING COUNT(distinct c.tag) >= 3

Algo así: no lo he probado