mysql触发器个人实战

create trigger idtrigger
before insert on flow_management_copy1
for each ROW
BEGIN
 SET new.ID= CONCAT(REPLACE(unix_timestamp(current_timestamp(3)),'.',''),FLOOR (RAND() * 10000));
END

 

 

show triggers;
 drop trigger idtrigger

posted @ 2019-11-19 17:18  那些年的代码  阅读(156)  评论(0编辑  收藏  举报