mysql自定义函数
1.创建带有参的函数
create function newdate() return varchar(20) return date_format(curdate(),'%Y年%m月%d日') select newdate(); --创建带有参的函数 create function show_name_store(bid int) return varchar(50) return (select concat_ws('----',book_name,store) from bookinfo where book_id=bid) select show_name_store(2015); --删除函数 drop function newdate; drop function if exists newdate
|
作者:chenze 出处:https://www.cnblogs.com/chenze-Index/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 如果文中有什么错误,欢迎指出。以免更多的人被误导。 |

浙公网安备 33010602011771号