with sample_data as (
select 1 id, 1 num, 'Hello' val from dual union all
select 1 id, 2 num, 'Goodbye' val from dual union all
select 2 id, 2 num, 'Hey' val from dual union all
select 2 id, 4 num, 'What''s up?' val from dual union all
select 3 id, 5 num, 'See you' val from dual)
select id,
NUM,
CASE
WHEN ID=1 THEN
SUM(NUM) OVER (PARTITION BY CASE WHEN NUM=3 THEN ID END )
END AS SUM_1,
from sample_data
任何人都可以帮助我理解这个查询是如何工作的。分区内的情况让我很难理解这个查询的结果集。我是我