← Foro de Oracle

llamar dos veces a la misma tabla

Hilo en el foro de Oracle · 08 de Marzo del 2005 · 1 respuestas
canario08 de Marzo del 2005
Pregunta
hola me gustaría que me ayudarais pq en una consulta intento llamar dos veces a la misma tabla con nombres diferentes y en una d ellas al intentar meter en la consulta una función calculada me da el siquiente error ORA-00979 y me dice que no es una función válida de GROUP BY


muchas gracias

Respuestas 1

yo08 de Marzo del 2005
He encontrado ésto en internet por si te sirve:

Error: ORA-00979: not a GROUP BY expression
Cause: You tried to execute a SELECT statement that included a GROUP BY function (ie: MIN, MAX, SUM, COUNT) and an expression in the SELECT list that was not in the GROUP BY clause.
Action: The options to resolve this Oracle error are:
Rewrite the SELECT statement so that the column or expression listed in the SELECT list is also found in the GROUP BY clause.
Remove the GROUP BY function (ie: MIN, MAX, SUM, COUNT) from the SELECT statement.
Remove the expression from the SELECT list that was not in the GROUP BY clause.

For example, if you had tried to execute the following SELECT statement:

SELECT department, company, MIN (salary) as "Lowest salary"
FROM employees
GROUP BY department;

You could correct this by including company in the GROUP BY clause as follows:

error message ORA-00979

SELECT department, company, MIN (salary) as "Lowest salary"
FROM employees
GROUP BY department, company;


¿Buscas más hilos como este? Mira el foro de Oracle o usa el buscador.