测试批量更新同行数据

-- -------------------------------------------
-- 批量更新同行数据
-- @author jis117
-- -------------------------------------------
SELECT LENGTH(t.image), SUBSTR(t.`image`, 1, LENGTH(t.image) - 3) FROM t_bt_movie_test t;
SELECT LENGTH(t.image), CONCAT(SUBSTR(t.`image`, 1, LENGTH(t.image) - 4), 'W.jpg') FROM t_bt_movie_test t;

UPDATE t_bt_movie_test t SET t.webImg = CONCAT(SUBSTR(t.`image`, 1, LENGTH(t.image) - 4), 'W.jpg');
SELECT t.image, t.webImg FROM t_bt_movie_test t;
-- -------------------------------------------

你可能感兴趣的:(测试)