Starting with 10g, Oracle introduced “Hash
Group By” as the default grouping by mechanism.
Oracle employs a hash algorithm to
calculate the hash value for each row based on the GROUP BY columns. This
allows rows with identical column values (and hence identical hash values) to
be "brought together" without performing a full sort. And then the
aggregation is performed upon each group. The hash group by does not guarantee
the order of the output, one should use “order by” clause to ensure the order.
select time_id, sum(amount_sold) from sales
group by time_id;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/638844/viewspace-776150/ ,如需转载,请注明出处,否则将追究法律责任。