4 Replies Latest reply on Jan 26, 2006 3:47 PM by dainge

    Error ORA-00937: not a single-group group function

    485923
      I have the following script:

      SELECT ar.ruta,dto.descripcion Departamento,mun.descripcion Municipio,
      SUM(DECODE(ar.diavisita,'1',COUNT(ar.no_cliente),0))lunes,
      SUM(DECODE(ar.diavisita,'2',COUNT(ar.no_cliente),0))Martes,
      SUM(DECODE(ar.diavisita,'3',COUNT(ar.no_cliente),0))Miercoles,
      SUM(DECODE(ar.diavisita,'4',COUNT(ar.no_cliente),0))Jueves,
      SUM(DECODE(ar.diavisita,'5',COUNT(ar.no_cliente),0))Viernes,
      SUM(DECODE(ar.diavisita,'6',COUNT(ar.no_cliente),0))Sabado
      FROM arccar ar, arccpro dto, arcccan mun, arccmc mc
      WHERE (mc.no_cia = ar.no_cia
      AND mc.centro = ar.centro
      AND mc.grupo = ar.grupo
      AND mc.no_cliente = ar.no_cliente)
      AND (dto.pais = mc.pais
      AND dto.zona = mc.zona
      AND dto.provincia = mc.provincia)
      AND (mun.pais(+) = mc.pais
      AND mun.provincia(+) = mc.provincia
      AND mun.canton(+) = mc.canton)
      AND mc.activo = 'S'
      AND ar.ruta = '311'
      AND ar.semana = '2'
      GROUP BY ar.ruta,dto.descripcion,mun.descripcion,ar.diavisita

      ...when I execute the query in PL/SQL Developer I get this error, Error ORA-00937: not a single-group group function.

      Can somebody help me.