mysql存储过程中怎么用date
2017-09-19
展开全部
mysql存储过程中怎么用date
DELIMITER $$
DROP PROCEDURE IF EXISTS `datatime`$$
CREATE
/*[DEFINER = { user | CURRENT_USER }]*/
PROCEDURE `iccsdb`.`datatime`()
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'*/
BEGIN
DECLARE dattime DATETIME DEFAULT '2013-10-10';
SELECT dattime FROM <a href="https://www.baidu.com/s?wd=DUAL&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1Y4mhuBuH01PADduyn1PAfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3En1m4PW61PjnznH6YPjc3nW0Y" target="_blank" class="baidu-highlight">DUAL</a>;
<a href="https://www.baidu.com/s?wd=END&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1Y4mhuBuH01PADduyn1PAfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3En1m4PW61PjnznH6YPjc3nW0Y" target="_blank" class="baidu-highlight">END</a>$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `datatime`$$
CREATE
/*[DEFINER = { user | CURRENT_USER }]*/
PROCEDURE `iccsdb`.`datatime`()
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'*/
BEGIN
DECLARE dattime DATETIME DEFAULT '2013-10-10';
SELECT dattime FROM <a href="https://www.baidu.com/s?wd=DUAL&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1Y4mhuBuH01PADduyn1PAfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3En1m4PW61PjnznH6YPjc3nW0Y" target="_blank" class="baidu-highlight">DUAL</a>;
<a href="https://www.baidu.com/s?wd=END&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1Y4mhuBuH01PADduyn1PAfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3En1m4PW61PjnznH6YPjc3nW0Y" target="_blank" class="baidu-highlight">END</a>$$
DELIMITER ;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询