0

我正在尝试在 oracle 11g 上使用以下内容:

select sum(ora_hash(distinct attribute) from table;

这给了我错误:ORA-00936:“缺少表达式”

我期待这能起作用,例如表中的 sum(distinct attribute); 工作正常。

有什么建议吗?

4

1 回答 1

1

这似乎是一个奇怪的结构。我会推荐:

 select sum(distinct ora_hash(attribute) from table;

(尽管sum(distinct)几乎从来都不是正确的构造。)

或者:

select sum(ora_hash(attribute))
from (select distinct attribute from table) t;
于 2017-05-09T16:13:52.337 回答