Dong Shin 08.19.2014

update comments in fr_master_table with value from fr_text_table where the comments don’t contain value…

UPDATE fr_master_table f SET comments = CONCAT(

IF(ISNULL( (SELECT value FROM (SELECT ftt.value, fmt.uid as uuid FROM fr_master_table fmt RIGHT JOIN fr_text_table AS ftt ON ftt.uid LIKE CONCAT(‘%’,fmt.uid, ‘_taskName’) AND fmt.comments NOT LIKE CONCAT(‘%’, ftt.value, ‘%’)) AS X WHERE f.uid = X.uuid)), ”,