Hi
Could someone tell me how I update field: 0 or 1 in table1 below. In this example Customer 1 should get values 1 in rows one and two, because his sum of amount is bigger than 15 in month 2. Other rows are null in this example.
table1
year month customer amount 0 or 1
2018 2 1 10 row1
2018 2 1 10 row2
2018 2 2 3 row3
2018 2 2 2 row4
2018 1 2 10 row5
select year,month,customer,sum(amount)
from table
group by year,month,customer
having sum(amount) > 15