我可以通过这种方式找到经验分布
select command_type, duration, round(percentage, 2)
from (select distinct command_type,duration_sec,
percent_rank() over(partition by command_type order by duration) percentage
from command_durations
order by 1, 2)
问题是如何使用oracle模型子句来做同样的事情。我已经开始了这个
select command_type,duration,dur_count from command_durations
model UNIQUE SINGLE REFERENCE
partition by (command_type)
dimension by ( duration)
measures(0 dur_count)
rules(
dur_count[duration]=count(1)[cv(duration)]
)
order by command_type,duration
但是现在我需要将记录区分开来,以便能够继续寻找经验分布。
如何在模型子句中区分记录?
答案 0 :(得分:1)
如果你想接受那个查询并在其上使用'distinct',一个方法可能是将它包装在From Subquery语句中,然后做一个不同的。例如:
Select Distinct command_type, duration, dur_count
From (
[Your Code]
)
如果有效,请告诉我。