请帮助我,我不知道该怎么做 我的记录是这样的: 从列d中可以看出,我希望L5TX值与同一列中的序列2和3连接。
A B C D E F
| 025640060503031 | 16042010 | 13:41:58 | 1L1TX | AVENGER | STRING 1 cesarin
| 667006050303120 | 17042010 | 12:18:57 | 3 .. | AVENGER | STRING 3 cesarin
| 667006050303120 | 17042010 | 12:18:57 | 2 .. | AVENGER | STRING 2 cesarin
| 667006050303120 | 17042010 | 12:18:57 | 1L5TX | AVENGER | STRING 1 cesarin
我希望输出类似于:
A B C D E F
| 025640060503031 | 16042010 | 13:41:58 | 1L1TX | AVENGER | STRING 1 cesarin
| 667006050303120 | 17042010 | 12:18:57 | 3L5TX | AVENGER | STRING 3 cesarin
| 667006050303120 | 17042010 | 12:18:57 | 2L5TX | AVENGER | STRING 2 cesarin
| 667006050303120 | 17042010 | 12:18:57 | 1L5TX | AVENGER | STRING 1 cesarin
答案 0 :(得分:1)
此查询提供所需的输出:
select a, b, c, rn||substr(fv, 2) d, e, f
from (
select a, b, c, d, e, f,
row_number() over (partition by a order by f) rn,
first_value(d) over (partition by a order by f) fv
from test)