Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Sequence number - per group

$
0
0

to keep it simple: Col1 and DateTime are Input

how to create an output (Result) like below?
so: sequence number per Col1 & incremental with DateTime ?

Col1DateTime Result
A  -   1  ->           1
A  - 2  ->           2
A  - 3  ->           3
B  - 4  ->           1
B  - 5  ->           2
A  - 6 -> 1
B  - 7 -> 2
B  -   8 -> 3





Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>