Update query over nested select query
update cc_info dst, ( select a_msisdn 
                      from cc_info 
                      where DATE(incoming_timestamp) ='2019-08-04' 
                        AND status = 3 
                      group by a_msisdn 
                      having count(*) &gt; 100 ) src
set dst.status = 4 
where dst.a_msisdn = src.a_msisdn