#创建存储过程或函数实现传入一个日期,bbin私网网上娱乐场:格式化成xx年xx月xx日并返回

DELIMITER $
CREATE PROCEDURE pp(IN mydate DATETIME,OUT nowdate VARCHAR(50) )
BEGIN
    SELECT DATE_FORMAT(mydate,'%y年%m月%d日') INTO nowdate;
END $

CALL pp(NOW(),@nowdate)$
SELECT @nowdate$

#创建存储过程实现传入女神名称,返回女神and男神 格式的字符串

CREATE PROCEDURE pp2(IN bName VARCHAR(20),OUT tname VARCHAR(50))
BEGIN
    SELECT CONCAT(bName,'and',IFNULL(bo.boyname,'null')) INTO tname
    FROM beauty b
    LEFT JOIN boys bo
    ON b.boyfriend_id=bo.id
    WHERE b.name=bName;
END $

CALL pp2('小昭',@tname) $
SELECT @tname $

#创建存储过程,根据传入的条目数和起始索引,查询beauty表的记录

CREATE PROCEDURE pp3(IN n INT,IN m INT)
BEGIN
    SELECT * 
    FROM beauty
    LIMIT m,n;

END $

CALL pp3(3,5)$