update statistic2 as s sethits = hits + (select count(*) from content_hit as h where s.user_id=h.user_id and s.content_id = h.content_id), unique_hits = unique_hits + sum(select count(distinct(ip)) as numips from content_hit where content_hit.user_id=s.user_id and content_hit.content_id=s.content_id and posted=1 and valid=1 group by year(created_date), month(created_date), day(created_date)),clicks = clicks + (select count(*) from content_click as h where s.user_id=h.user_id and s.content_id = h.content_id),unique_clicks = unique_clicks + sum(select count(distinct(ip)) as numips from content_click where content_click.user_id=s.user_id and content_click.content_id=s.content_id and active=1 group by year(created_date), month(created_date), day(created_date) ) ;