mysql函数与事件

函数写法

```

CREATE PROCEDURE test ()

BEGIN

UPDATE `sgo_want_orders` SET audit=20

WHERE unix_timestamp(now()-interval 900 second)  > create_time

and audit=1

and type <> 1 ;

END

```

创建事件

```

create event if not exists e_test

on schedule every 30 second

on completion preserve

do call test();

```

你可能感兴趣的:(mysql函数与事件)