Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/07/2004, 00:12
Atzeneta
 
Fecha de Ingreso: junio-2004
Ubicación: Castellón, España
Mensajes: 98
Antigüedad: 19 años, 9 meses
Puntos: 0
Puede ser algo así:

SELECT tienda_id, producto_id FROM tabla INNER JOIN (SELECT Count(producto_id) AS Cuenta, tienda_id FROM tabla GROUP BY tienda_id) AS cns ON tabla.tienda_id=cns.tienda_id ORDER BY Cuenta