Can anyone explain Oracle's limitations as far as why the following statement works in MySQL, but receives a "not a GROUP BY expression" in Oracle?
SELECT order1.user_id,
order1.order_datetime,
SUM(order2.order_total)
FROM order_table order1
JOIN order_table order2 ON order1.user_id = order2.user_id
GROUP BY order1.user_id
Is it because Oracle doesn't know how to handle the order_datetime
column? Can't it just return the column result from whichever row it receives from the GROUP BY order1.user_id
row, as it does in MySQL?
EDIT:
I understand that all columns should be in the group by, however I'm trying to understand why Oracle doesn't return a similar result as MySQL does (whereas MySQL doesn't require each GROUP BY, and Oracle does).