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

原文地址:https://www.cnblogs.com/zhuyeshen/p/11890796.html