user_training_id user_id training_id training_date
1 1 1 "2015-08-02"
2 2 1 "2015-08-03"
3 3 2 "2015-08-02"
4 4 2 "2015-08-04"
5 2 2 "2015-08-03"
6 1 1 "2015-08-02"
7 3 2 "2015-08-04"
8 4 3 "2015-08-03"
9 1 4 "2015-08-03"
10 3 1 "2015-08-02"
11 4 2 "2015-08-04"
12 3 2 "2015-08-02"
13 1 1 "2015-08-02"
14 4 3 "2015-08-03"
Select * from ( select userid, tranidate, Rank()over(partition by trainingdate
order by user id) as nooftrainings from traning) traningcentre where
nooftrainnings>1;
week_nbr, txn_dt, net_sales
202501, 2025-01-01, 20
202501, 2025-01-02, 30
202501, 2025-01-04, 10
202502, 2025-01-05, 20
202502, 2025-01-06, 30
202502, 2025-01-07, 10
202503, 2025-01-13, 20
202503, 2025-01-14, 30
202503, 2025-01-15, 40