- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
-- Из простого...
select kdet, cexnum, cex, last_value(cex) over(partition by kdet) as final_cex
from xxtpa_rout_aztpa_v;
-- Сделаем сложное...
select t.*, max(max_cex) over(partition by kdet, rout_num) max_cex
from (select t.*, case cex_num when max(cex_num) over(partition by t.kdet, t.rout_num) then t.cex else null end max_cex
from xxtpa_rout_aztpa_v t) t;
Lure Of Chaos 22.04.2011 15:16 # 0
Максимка!
bugmenot 22.04.2011 16:07 # 0
Lure Of Chaos 22.04.2011 16:11 # 0
guest 23.04.2011 12:23 # 0
dwinner 23.04.2011 14:22 # +1