给你个olap 函数参考:select accto, bal, trandate,coalesce(min(trandate) over (partition by accto order by to_date(trandate, 'YYYY-MM-DD HH24:MI:SS') nulls last rows between 1 following and 1 following),'2010-12-31 00:00:00') next_trandatefr...
显示全部给你个olap 函数参考:
select accto, bal, trandate,
coalesce(
min(trandate) over
(partition by accto order by to_date(trandate, 'YYYY-MM-DD HH24:MI:SS') nulls last rows between 1 following and 1 following),
'2010-12-31 00:00:00'
) next_trandate
from table(values
(102012011, 81.23, '2010-01-03 00:00:00'),
(102012011, 100.21, '2010-01-05 00:00:00'),
(102012011, 481.23, '2010-02-04 00:00:00')
)
as t(accto, bal, trandate)
收起