UPDATE eng_main SET length SELECT SUM LENGTH name count AS sum FROM en

1
2
3
4
5
6
UPDATE `eng_main`
SET `length`=(SELECT SUM((LENGTH(`name`)*`count`)) AS `sum`
FROM `eng_words`
INNER JOIN `eng_assign`
ON `eng_words`.`id`=`eng_assign`.`word_id`
WHERE `url_id`=`eng_main`.`id`)