摘要: DROP EVENT IF EXISTS eve1;DELIMITER $$CREATE EVENT eve1 ON SCHEDULE EVERY 1 SECOND STARTS NOW() ENDS NOW()+1ON COMPLETION PRESERVEDISABLEDOBEGINUPDATE testtable1 SET age = age+1 WHERE id = 1;END$$DELIMITER ;SELECT * FROM testtable1;SELECT NOW();/*标准创建语句EventsEventsCREATE EVENT 事件任务名称 ON SCHEDULE AT 阅读全文
posted @ 2012-10-25 16:14 风吹屁股凉冰冰 阅读(2340) 评论(0) 推荐(0) 编辑
摘要: DELIMITER $$DROP FUNCTION IF EXISTS test_fun1$$CREATE FUNCTION test_fun1 (df1 INT) RETURNS VARCHAR(20)DETERMINISTICCONTAINS SQLSQL SECURITY DEFINERCOMMENT '这是函数的描述'BEGINSET df1 = 13;INSERT INTO testtable1(NAME)VALUES('li');SELECT COUNT(*) INTO @cun FROM testtable1;RETURN @cun+"& 阅读全文
posted @ 2012-10-25 11:28 风吹屁股凉冰冰 阅读(3814) 评论(0) 推荐(0) 编辑