my_table
no
|
my_group
|
group_count
|
1
|
A
|
1
|
2
|
A
|
2
|
3
|
A
|
3
|
4
|
A
|
4
|
5
|
B
|
1
|
6
|
B
|
2
|
7
|
B
|
3
|
8
|
C
|
1
|
9
|
C
|
2
|
10
|
D
|
1
|
query
select my_group, group_count, last_value(group_count) over (partition by my_group) last_group_count from my_table
no
|
my_group
|
group_count
|
last_group_count
|
1
|
A
|
1
|
4
|
2
|
A
|
2
|
4
|
3
|
A
|
3
|
4
|
4
|
A
|
4
|
4
|
5
|
B
|
1
|
3
|
6
|
B
|
2
|
3
|
7
|
B
|
3
|
3
|
8
|
C
|
1
|
2
|
9
|
C
|
2
|
2
|
10
|
D
|
1
|
1
|
ไม่มีความคิดเห็น:
แสดงความคิดเห็น