0
組錯誤我在PostgreSQL的9.4得到一組誤差範圍內:在PostgreSQL中
錯誤:在需要GROUP有序集總排名 4號線:(選擇a1.rank爲r1,
create view a as (select rank() over (order by pid, time)
pid, event, time
from test5);
select e1.prev, e1.event, count(*)
from
eventtransitions as e1,
(select a1.rank as r1,
a2.rank as r2,
a1.event as a1_event,
a2.event as a2_event,
a1.pid as a1_pid,
a2.pid as a2_pid
from a as a1, a as a2) as temp
where r1 = r2-1
and e1.event = a2_event
and e1.prev = a1_event
and a1_pid = a2_pid
group by e1.prev, e1.event;
這對我來說有點奇怪,因爲根據我對這個錯誤的理解,這意味着我需要爲我的聚合函數級別設置order by子句,但是我確實使視圖成爲了一個,並且我有order by子句在那裏,我該如何解決這個錯誤,以及我所做的假設是不正確的?