Skip to content

Instantly share code, notes, and snippets.

@keehyun2
Created July 29, 2017 04:31
Show Gist options
  • Save keehyun2/2d9204535a76b3f8aecf4927be7ad0e3 to your computer and use it in GitHub Desktop.
Save keehyun2/2d9204535a76b3f8aecf4927be7ad0e3 to your computer and use it in GitHub Desktop.
update
test_k a
left outer join(
select parent, floor(avg(progress)) as avg
from test_k
group by parent
) b on a.id = b.parent
set
a.progress = b.avg
where
avg is not null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment