Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/07/2014, 13:16
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, 9 meses
Puntos: 774
Respuesta: Filtrar cabeceras de columnas de acuerdo a un criterio

Código SQL:
Ver original
  1. SELECT telefono, departamento,
  2. servicio,
  3. CASE WHEN servicio='Entrante' THEN E1 ELSE s1 END AS dia1,
  4. CASE WHEN servicio='Entrante' THEN E2 ELSE s2 END AS dia2,
  5. CASE WHEN servicio='Entrante' THEN E3 ELSE s3 END AS dia3,
  6. CASE WHEN servicio='Entrante' THEN E4 ELSE s4 END AS dia4,
  7. CASE WHEN servicio='Entrante' THEN E5 ELSE s5 END AS dia5
  8. FROM tabla

algo asi no funciona???
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me