Questions tagged [ora-00934]

ORA-00934: group function is not allowed here

Error: group function is not allowed here

Cause: One of the group functions, such as AVG, COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, was used in a WHERE or GROUP BY clause.

Action: Remove the group function from the WHERE or GROUP BY clause. The desired result may be achieved by including the function in a subquery or HAVING clause.

5 questions
6
votes
5 answers

In PL/SQL, how do you update a row based on the next row?

I'm using Oracle PL/SQL. I have a timestamped table T, and I want to set a row's value for column A to be the same as that of the previous row, if they're sorted by columns B and Timestamp, provided that the timestamps are not different by more than…
Isaac Moses
  • 1,589
  • 6
  • 26
  • 44
1
vote
6 answers

Help with this SQL query

The follow query is returning an error at column 143: "ORA-00934: group function is not allowed here" SELECT * FROM TBLENTITYLOCATION TL INNER JOIN TBLENTITY TE ON TE.ENTITYID = TL.ENTITYID WHERE TE.ENTITYNAME = 'foobar' AND LOCATIONDATETIME =…
Dan
  • 724
  • 1
  • 9
  • 19
0
votes
2 answers

ORA-00934: Group function not allowed here || Selecting MIN(Salary) of highest paid dept

O community, do you know how I could select the department_ID, and lowest salary of the department with the highest average salary? Or how to eliminate the'ORA-00934: group function not allowed here' issue? Would I need to use two subqueries? So…
user1260503
0
votes
1 answer

Why does adding conditions to my query cause an ORA-00934 error message?

I have the following query: select a.tablespace_name "Tab_name", ROUND(SUM(a.bytes)/1024/1024/1024, 2) "Sum_files_GB", ROUND(SUM(decode(b.maxextend, null, A.BYTES/1024/1024/1024, b.maxextend*C.BLOCK_SIZE/1024/1024/1024)), 2)…
0
votes
2 answers

Group functions of outer query inside inner query

I'm using Oracle. I'm trying to compose something like this: SELECT trans_type, (SELECT parameter_value FROM transaction_details WHERE id = MAX(t.trans_id)) FROM (SELECT trans_id, trans_type FROM transactions) t GROUP BY trans_type So, I am trying…
Ariod
  • 5,757
  • 22
  • 73
  • 103