how to add flag sequence number in unique and duplicate value using sql
i have table A with 2 columns was filled: Date, product. and column count still empty
my expectation, if same product have in same date then count 1.
i got stuck, thanks before
Solution – 1
You may use
SELECT date, product, DENSE_RANK() OVER (ORDER BY date, product) count FROM yourTable ORDER BY date, product;