|    
			
				28/04/2005, 12:19
			
			
			  | 
  |   |  |  |  |  Fecha de Ingreso: diciembre-2004 
						Mensajes: 54
					 Antigüedad: 20 años, 10 meses Puntos: 0 |  | 
  |  Una solución enrevesada en ms sql server:select sum((case cantidad2 when 0 then 0 else cantidad1 end)/(case cantidad2 when 0 then 1 else cantidad2 end)) from tabla
 
 Si te da igual no sacar los registros con cantidad2=0
 SELECT SUM(cantidad1/cantidad2) FROM tabla where cantidad2<>0
 GROUP BY id_producto
 
 Salu2.
     |