select distinct ti.callingnum,
ti.callednum,
case
when substr(ti.callednum, 1, 2) <> '00' and
substr(ti.callednum, 1, 3) <> '100' then
0
else
sum(ti.concost)
over(partition by callednum,
callednum order by ti.callednum)
end leijia
from test ti
where CALLINGNUM = '0664196'
and CALLEDNUM = '10086';
如果你两条数据不一样的情况下都会显示出来,只有完全一样才会过滤掉,如果两条数据不一样,你想显示几条呢?
oracle 分析函数中 keep关键字的使用