ora 923SQL 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 okYou are missing the comma between them. Which is why Oracle believes the word FROM was missing at the end of the third . Fix this and