1
|
<
font
style
=
"color:rgb(79, 79, 79)"
>
<
font
face
=
"-apple-system, ""
>
<
font
style
=
"font-size:16px"
>
select
t.
*
,
row_number
(
)
over
(
partition
by
accno order
by
createDate
)
row_number
from
Test t
<
/
font
>
<
/
font
>
<
/
font
>
|
1
|
<
font
style
=
"color:rgb(79, 79, 79)"
>
<
font
face
=
"-apple-system, ""
>
<
font
style
=
"font-size:16px"
>
select
t.
*
,
rank
(
)
over
(
partition
by
accno order
by
createDate
)
rank
from
Test t
<
/
font
>
<
/
font
>
<
/
font
>
|
1
|
<
font
style
=
"color:rgb(79, 79, 79)"
>
<
font
face
=
"-apple-system, ""
>
<
font
style
=
"font-size:16px"
>
select
t.
*
,
dense_rank
(
)
over
(
partition
by
accno order
by
createDate
)
dense_rank
from
Test t
<
/
font
>
<
/
font
>
<
/
font
>
|
1
|
<
font
style
=
"color:rgb(79, 79, 79)"
>
<
font
face
=
"-apple-system, ""
>
<
font
style
=
"font-size:16px"
>
select
createDate
,
accno
,
money
,
row_number
from
(
select
t.
*
,
row_number
(
)
over
(
partition
by
accno order
by
createDate
)
row_number
from
Test t
)
t
1
where
row_number
<
4
<
/
font
>
<
/
font
>
<
/
font
>
|
更多技術資訊可關注:gzitcastsql