Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/03/2014, 15:08
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: Tunning de Query

a lo que veo eso lo haces para evitar la division entre 0,

porque no intentas esto




Código SQL:
Ver original
  1. SELECT
  2. isnull( (DG.PrecioImporte * (DG.CEPrograma_Ene / DG.TotDiasDEvengar)),0) AS imp_enero
  3. .
  4. .
  5. .
  6. .
  7. FROM tabla WHERE DG.TotDiasDEvengar>0

asi te evitas todos los case que estas usando :)
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me