Ver Mensaje Individual
  #6 (permalink)  
Antiguo 29/11/2005, 08:11
monkyta
 
Fecha de Ingreso: noviembre-2005
Mensajes: 658
Antigüedad: 18 años, 6 meses
Puntos: 3
Dorita no me habia fijado que el group by estaba mal ubicado... prueba esto

CREATE VIEW V_CLIENTE_LLAMADO
(SERVICIO, RUT_CLIENTE1, CUENTA)
AS
select
case c.NMRO_EVENTO1
when '106' then 'TV'
when '107' then 'FONO'
when '108' then 'INTERNET'
when '109' then 'VISITAS'
else 'NADA'
end SERVICIO,
n.RUT_CLIENTE1,count(*) cuenta
from IVT_LOGSIVR_prueba n
group by n.NMRO_EVENTO1,n.RUT_CLIENTE1
having count(*) >= 2