Reputation: 3
I'm trying to create an sql statement
SELECT ACTIVITY_ID, ACTIVITY_DESCRIPTION,
I've selected task activity because it joins the 4 tables together
COUNT(*) NAME AS NAMECount
I use the above count statement to count the number of volunteers
DESCRIPTION AS TASK
FROM
here's the inner join
TASK_ACTIVITY
INNER JOIN
VOLUNTEER ON VOLUNTEER.VOLUNTEER_ID = TASK_ACTIVITY.VOLUNTEER_ID
INNER JOIN
TASK ON TASK.TASK_ID = TASK_ACTIVITY.TASK_ID
GROUP BY VOLUNTEER.NAME;
and I get this error
ORA-00923: FROM keyword not found where expected
Upvotes: 0
Views: 543
Reputation: 5155
You can use below query. Provide the alias in the column names and group by columns to make it work as you did not mention what column belongs to what table
SELECT ACTIVITY_ID,
ACTIVITY_DESCRIPTION,
COUNT(*), NAME AS NAMECount,
DESCRIPTION AS TASK
FROM TASK_ACTIVITY TASK_ACTIVITY
INNER JOIN
VOLUNTEER VOLUNTEER
ON VOLUNTEER.VOLUNTEER_ID = TASK_ACTIVITY.VOLUNTEER_ID
INNER JOIN
TASK ON TASK.TASK_ID = TASK_ACTIVITY.TASK_ID
GROUP BY ACTIVITY_ID, ACTIVITY_DESCRIPTION, TASK, VOLUNTEER.NAME;
Upvotes: 0