Hi Team,
I am using MS sql server 2008 R2,
Please find my query,
I have a table and the data is as follows,
actor_id | TRAN_DATE | tot_amt | breached_date |
16887 | 3/30/2015 21:27 | 5000 | |
16887 | 3/29/2015 20:35 | 5500 | >10000 |
80205 | 3/30/2015 19:39 | 6139 | |
80205 | 3/30/2015 21:19 | 2000 | |
80205 | 3/31/2015 13:11 | 39340 | >10000 |
80205 | 3/30/2015 6:59 | 15700 | |
122576 | 3/30/2015 20:28 | 17375 | |
122576 | 3/30/2015 15:53 | 1474.98 | |
122576 | 3/31/2015 21:02 | 17240 | >10000 |
122576 | 3/31/2015 23:02 | 17600 |
Here I have to write a query in which I should be able to retrive the actor_id and their breached dates
output shoule be: I should be able to pick the highlighted rows
actor_id | TRAN_DATE | tot_amt | Cumilative of each ID | breached_date |
16887 | 3/30/2015 21:27 | 5000 | 5000 | |
16887 | 3/29/2015 20:35 | 5500 | 10500 | >10000 |
80205 | 3/30/2015 19:39 | 6139 | 6139 | |
80205 | 3/30/2015 21:19 | 2000 | 2000 | |
80205 | 3/31/2015 13:11 | 39340 | 41340 | >10000 |
80205 | 3/30/2015 6:59 | 15700 | 15700 | |
122576 | 3/30/2015 20:28 | 1737 | 1737 | |
122576 | 3/30/2015 15:53 | 1474.98 | 1474.98 | |
122576 | 3/31/2015 21:02 | 17240 | 20451.98 | >10000 |
122576 | 3/31/2015 23:02 | 17600 | 36314.98 |
Please could you help me in this regards.
Thanks,
Rajendra Lella