update test set name = case when id = 7 then 'LL1' when id = '8' else name end
需要注意,要考虑else情况,将原name赋值回去,否则会使id不为7和8的name变为null
CREATE/*[DEFINER = { user | CURRENT_USER }]*/
TRIGGER test.t_usergetnews AFTER INSERT
ON test.t_news
FOR EACH ROW BEGIN
UPDATE t_users SET newnews=CONCAT(newnews,'|',new.nid) WHERE deleta = 0
END$$
试试看
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)