ora 923ORA-00923 occurs when you try to execute a SELECT or REVOKE statement without a FROM keyword in its correct form and place. If you are seeing this error, the keyword FROM isSQL Error: ORA-00923: FROM keyword not found where expected. Can anyone tell me where I'm going wrong with this? you don't need the WITHIN GROUP clause. it's ok