I’m trying to run the following query:
SELECT parent_id, id, due_date, object_subtype
FROM amatia_logtask
WHERE parent_id IN (SELECT id_actividad
FROM amatia_actividades
WHERE id_actividad = '12624'
OR id_padre = '12624')
GROUP BY parent_id id
However, I’m unable to understand the error message:
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Error at Line: 9 Column: 41
Please can you provide an explanation?
The
GROUP BYclause is a comma separated list of columns or expressions, so you’re missing a comma.You will still get an error since all expressions in the SELECT clause need to be either grouped by or aggregates (using aggregate functions).
So you may want to write:
A
GROUP BYquery without aggregates is essentially aDISTINCTquery, so you can also use distinct here to hint at your intent: