• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

ORACLE SQL TROUBLES!!! PLEASE HELP

piski

Senior member
I am creating a view to show a price list. The price list is to show the total amount of money I have spent on each item. therefore the view is to be grouped by item_id. When I create the view without the group by statement, it works fine but i get 2170 records. So I want to group them

When I do so it tells me that :

ERROR at line 5:
ORA-00933: SQL command not properly ended

Here is my code:

CREATE VIEW E_V AS
SELECT ORDER_LINE_T.ITEM_ID, ITEM_T.DESCRIPTION
FROM ORDER_LINE_T, ITEM_T,ORDER_TOTAL_V, VENDOR_ORDER_T
GROUP BY ORDER_LINE_T.ITEM_ID
WHERE ORDER_LINE_T.ITEM_ID = ITEM_T.ITEM_ID;


pLEASE HELP ME. I AM GOING INSANE

THANK YOU
 
I suggest moving where statement ahead of the group by. But that is not the problem.

Your problem is that you need to group by everything except that which is in an aggregate function, so you need to group by ITEM_T.DESCRIPTION as well. You don't have any aggregate functions.
 
Back
Top