tommy-huang

直接看例子:

DELIMITER $$
CREATE DEFINER=`root`@`127.0.0.1` PROCEDURE `restore`(username varchar(50))
BEGIN
if username is not null then
    update user set invalid=0 and activate_time=\'0000-00-00 00:00:00\' where `name`=username;
else
    update user set invalid=0 and activate_time=\'0000-00-00 00:00:00\';
end if;
END$$
DELIMITER ;

调用:

1. call restore(\'abc\');

   or call restore(null);

 

分类:

技术点:

相关文章:

  • 2021-12-10
  • 2021-12-10
  • 2021-12-04
  • 2021-12-04
  • 2021-12-31
  • 2021-12-04
  • 2021-12-04
猜你喜欢
  • 2022-01-07
  • 2022-01-07
  • 2022-02-24
  • 2021-12-10
  • 2022-02-28
  • 2022-02-02
  • 2021-12-10
相关资源
相似解决方案