Last active
February 28, 2017 01:05
-
-
Save enujo/2b0598cf43f05263f26a453dfbdd2061 to your computer and use it in GitHub Desktop.
mileage_cate테이블에서 값을 가져와 mileage테이블에 있는값 더하기
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE | |
tb_person p | |
SET | |
p.person_total_mileage = | |
(SELECT | |
SUM(mct.mileage_cate_price - m.mileage_use_price) | |
FROM | |
tb_mileage m | |
JOIN | |
tb_mileage_cate mct | |
ON m.mileage_cate_cd = mct.mileage_cate_cd | |
WHERE | |
m.person_id = 'person3' | |
) | |
WHERE | |
p.person_id ='person3' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment