ora 923ORA-00923: FROM keyword not found where expected Below is the SQL : SELECT A.Agent_key, Sum(Total_Orders) FROM (SELECT A.Agent_key, Sum(Total_Orders)SQL 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