Hakan Axheim

Hakan Axheim

  • 1.4k
  • 201
  • 29.4k

Regarding Over Partition

Nov 4 2020 3:31 AM
Hi,
 
I have a question regarding Over(Partition by
 
This is a short description of my data.
 
Customer Id     Product Id   CreateDate
10                     A                 2020-01-01
10                     A                 2020-01-01
10                     B                 2019-11-01
10                     B                 2019-11-01
20                     A                 2020-03-01
 
I need a query that shows the information as below;

Customer Id Product Id CreateDate     SequenceNo
10                 A                2020-01-01    1
10                 A                2020-01-01    1
10                 B                2019-11-01    2
10                 B                2019-11-01    2
20                 A                2020-03-01    1
 
How can I write a query in SQL that shows the information above?
 
 
 

Answers (3)